1. Connect Linux using SECURECRT
(securecrt: Link: https://pan.baidu.com/s/1o9hPNlC password: xp00)
2, right-click the window, select Connect SFTP Session, such as:
3. In the Sftp window, enter: Put d:jdk-8u151-linux-i586.tar.gz
(Path is the path to the JDK on your own hard drive, jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
4, cd/usr switch to the USR directory. mkdir Java Create folder java. The CD is switched to the root directory. The CP Jdk-8u151-linux-i586.tar.gz/usr/java copies the JDK installation package from the root directory to the Usr/java directory. RM-RF jdk-8u151-linux-i586.tar.gz Remove the installation package from the root directory. Cd/usr/java switch to the Java directory.
5, TAR-ZXVF jdk-8u151-linux-i586.tar.gz decompression, finished LS look at the directory structure, you can see this time in the Java directory more than a jdk1.8.0_151
6, Vim/etc/profile set environment variables, at the front of the file to join
Export java_home=/usr/java/jdk1.8.0_151 export jre_home=${java_home}/jre export classpath=.:${java_home}/ Lib:${jre_home}/lib export path=${java_home}/bin: $PATH
Then exit edit
7, Source/etc/profile
Execute profile
8, Java-version
Appear:
Java Version "1.8.0_151"
Java (TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot (TM) Client VM (build 25.151-b12, Mixed mode)
This information indicates that the JDK installation was successful
Linux installation JDK