I. wget command download JDK
wget --no-check-certificate --no-cookies --header
"Cookie: oraclelicense=accept-securebackup-cookie"
download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gztwo. Extracting FilesTAR-ZXVF
jdk-8u111-linux-x64.tar.gz three. Set environment variables (three ways)The first type is configured in/usr/profile:Vi/usr/profileExprot java_home=/usr/local/jdk1.8.0_111
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Exprot path= $JAVA _home/bin: $PATH
Source/usr/profile Making changes effective
The second is configured in the current user's. Bash_profile (root user in/root):
Operation is the same as the first method
We need source/usr/profile .
The third current shell is set directly below
Four, to see if the command was executed successfully Java-version
Uninstalling the JDK
_uninst subdirectory of the JDK installation directory
The shell terminal executes the command ./uninstall.sh
Note: If you encounter the source is not good to make recommendations to check your own configuration of the code if there is a problem (typos or something)
Linux JDK environment variable configuration