1 First confirm whether Linux is installed on the Java, if there is no need to install.
Check method: Linux command: java-version
2 If there is no similar hint, it proves that Java is not installed, then see if Linux is 64-bit or 32-bit, so choose which version of the JDK to download
Command: getconf long_bit
3 Downloads jdk8:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
After the download is complete: jdk-8u181-linux-x64.tar.gz
4 after downloading, you can use the FTP tool (FileZilla or WINSCP), the compression package to Linux (set up the JVM folder under the Linux usr/lib, copy the compressed package to the JVM folder)
Go to the JVM folder: CD/USR/LIB/JVM
Decompression JDK-8U181-LINUX-X64.TAR.GZ:TAR-ZXVF jdk-8u181-linux-x64.tar.gz
After unpacking the folder appears as follows: jdk1.8.0_181/
5 Setting environment variables
Modify/etc/The following profile: Vi/etc/profile
The insertion at the end of the file resembles the following:
Export JAVA_HOME=/JDK parent folder path/jdk1.8.0_121 (e.g./root/jvm/jdk1.8.0_121)
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
The author adds:
Export java_home=/usr/lib/jvm/jdk1.8.0_181
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
May use the vim commonly used command to refer to: https://www.cnblogs.com/kxm87/p/9551105.html
6 Let the file you just modified take effect: Source/etc/profile
7 go back to the first step to check the JDK version or enter Java as pop-up if the installation succeeds
Installing JDK on Linux