1. Log in to Linux, switch to root user su root to get root user rights, the current working directory is unchanged (requires root password) or sudo-i does not need root password to switch directly to root (requires the current user password) 2. Creating the Java installation directory in the USR directoryCd/usrmkdir Java3. Copy the jdk-8u60-linux-x64.tar.gz to the Java directorycp/mnt/hgfs/linux/jdk-8u60-linux-x64.tar.gz/usr/java/4. Unzip the JDK to the specified directoryTAR-ZXVF jdk-8u60-linux-x64.tar.gz-c/usr/localsGet the folder jdk1.8.0_605. Installation completed for him to create a link to save the directory length (I didn't use this step)ln-s/usr/java/jdk1.8.0_60//usr/jdk6. Edit the configuration file, configure environment variablesVim/etc/profileAdd the following: Java_home according to the actual directory tojava_home=/usr/java/jdk1.8.0_60classpath= $JAVA _home/lib/path= $PATH: $JAVA _home/binexport PATH Java_home CLASSPATH7. Restart the machine or execute the command: Source/etc/profilesudo shutdown-r now8. View installation Java-versionjava version "1.8.0_60" Java (tm) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot (tm) Client V M (build 25.60-b23, Mixed mode)
Linux under JDK installation steps