1 Create a new two folder one to store the installation files, one to store the extracted files
Mkdir-p/export/software // store installation files mkdir-p/export/servers // store extracted files
2 Place the JDK files in the software folder on the server and extract them into the servers folder
Cd/export/software //tar-zxvf jdk-8u141-linux-x64.tar.gz-c/export/servers/ // Unzip
3 Uninstall the JDK that comes with your system
Rpm-qa | grep java // search rpm-e--nodeps java-1.7. 0-openjdk-1.7. 0.131-2.6. 9.0. el6_8.x86_64 // uninstall rpm-e--nodeps tzdata-java-2016j-1 -e--nodeps java-1.6. 0-openjdk-1.6. 0.41-1.13. 13.1. el6_8.x86_64
4 editing the configuration file declaration environment variables
Vim/etc/profile // Edit configuration file export JAVA_HOME=/EXPORT/SERVERS/JDK1. 8. 0_141 // end add export path= $PATH: $JAVA _home/bin
5 Recompile
Source/etc/profile // recompile java-version
Linux installation JDK