1. Check the jdk version in the system: java -version
2. Detect jdk installation package: rp m -qa | grep java
3. Uninstall openjdk
rpm -e --nodeps tzdata-java-2017b-1.el7.noarch
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64
4. Upload and decompress the software package
Link: https://pan.baidu.com/s/1A2-aeVpVpJhPzegdzYUYSw
Extraction code: osm3
tar -xvf jdk-8u181-linux-x64.tar.gz
5. Settings and environment variables, add the following configuration in the /etc/profile file
export JAVA_HOME=/software/jdk1.8.0_181
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
6. Check whether the configuration is successful
java -version