Refer to an article Baidu experience: http://jingyan.baidu.com/article/eb9f7b6d8f82a6869364e8a7.html
When setting up the JDK environment, add the following lines at the end of the/etc/profile file:
Export Java_home=/usr/lib/jvm/jdk1.8.0_73export classpath= $CLASSPATH: $JAVA _home/libexport path= $PATH: $JAVA _home/ Bin
Where jdk1.8.0_73 is the JDK decompression package name extracted in the/USR/LIB/JVM folder
After the profile file is saved, log out of the Linux system to make it effective, log in to the Linux system, and enter the command in the terminal:
[Email protected]:~$ java-version
The following information appears:
Java version "1.8.0_73" Java (tm) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot (tm) 64-bit Server VM (Build 25.73- B02, Mixed mode)
Indicates that the JDK configuration was successful.
This article is from the "10628473" blog, please be sure to keep this source http://10638473.blog.51cto.com/10628473/1766484
Configuration of JDK environment under Ubuntu15.10 system