1. Download JDK http://www.oracle.com/technetwork/cn/java/javase/downloads/index.html on the website if it is a 64-bit operating system, you can download 64-bit or 32-bit JDK, However, a 32-bit system cannot run a 64-bit JDK.
2, decompression jdk-x.x.x.tar.gz, put the installation package in the file directory you want to put, use the command TAR-ZXVF jdk-x.x.x.tar.gz.
3. Add the JDK to the operating system environment and use the command sudo vim/ect/profile to add a field after the file. Modify Exit.
Export JAVA_HOME=/USR/JAVA/JDK1. 8 . 0_151export CLASSPATH=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarexport PATH= $JAVA _home/ Bin: $PATH
4. Use the command Source/ect/profile to run the file. (Source function: Causes the current shell to read into a shell file with a path of FilePath and executes all the statements in the file, usually to re-execute the newly modified initialization file for immediate effect without having to log off and log back in)
5. Use Java-version to test whether the configuration is successful. If the JDK version information is output, the configuration is successful.
Configuring the JDK environment on Linux systems