1 Java 8
http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html
2 Log the downloaded jdk-8u92-linux-x64.tar.gz file to the/temp directory with the root user login and unzip it using the following command
tar zxvf jdk-8u92-linux-x64. tar. gz
3 Copy the extracted jdk1.8.0_92 to/opt under the following command:
[Email protected]:~# mkdir/temp
[Email protected]:~# cd/temp
[Email protected]:/temp# tar zxvf jdk-8u92-linux-x64.tar.gz
[Email protected]:/temp# cd/opt
[Email protected]:/opt# mv/temp/jdk1.8.0_92/.
[Email protected]:/opt# ls-l
Total Dosage 4
Drwxr-xr-x 8 UUCP 143 4096 April 1 12:20 jdk1.8.0_92
4 Creating a Java Soft link in the/bin directory
[Email protected]:/opt# cd/bin
[Email protected]:/bin# ln-s/opt/jdk1.8.0_92/bin/java java
Verify the correctness of the software connection
[Email protected]:/bin# java-version
Java Version "1.8.0_92"
Java (TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.92-b14, Mixed mode)
5 Setting up the Java environment
[Email protected]:/bin# gedit/etc/profileexport java_home=/opt/java1. 8 . 0_92export jre_home=${java_home}/jreexport CLASSPATH=.:${java_home}/lib:${jre_home}/ Libexport PATH={java_home}/bin: $PATH [email protected]:/bin# source/etc/profile[email protected]: echo $JAVA _home/opt/java1. 8. 0_92
6 Switch to other user authentication
Echo $JAVA _home/opt/java1. 8 . 0_92[email protected]:~$ java-"1.8.0_92"1.8. 0_92 -25.92-b14, Mixed mode)
Ubuntu 16.04 Installing Java 8