Every time I feel like this is super simple, but every time you check it out, remember.
To install the JDK under Linux, proceed as follows
1: Download the JDK Package: This chapter uses a file with the suffix tar.gz (no installation required), such as jdk-8u111-linux-x64.tar.gz
2: Save the JDK file to the Linux directory: Use the mkdir command to generate the User/java directory from the console, and put the file under it
3: Unzip the tar.gz file: Through the console, enter User/java, execute $ tar zxvf jdk-8u111-linux-x64.tar.gz, unzip it
4: Configure Environment variables: Open the console, run sudo vi/etc/profile, insert the content you want to configure at the end, press ESC, enter (: Wq Save and exit)
Java_home=/home/gcs/user/java/jdk1.8.0_111path= $JAVA _home/bin: $PATHCLASSPATH =.: $JAVA _home/lib/dt.jar: $JAVA _ Home/lib/tools.jarexport Java_homeexport Pathexport CLASSPATH
5: Run $ source/etc/profile to make the configuration environment effective
6: Run $ java-version to see if it takes effect. If the JDK version number appears, install and configure the environment variable successfully
Installing Java's JDK and configuration environment variables under Linux