1、卸载OpenJDK,下载JDK最新版本,然后安装:
rpm -qa | grep java
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.131-2.6.9.0.el7_3.x86_64
rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.131-2.6.9.0.el7_3.x86_64
rpm -e --nodeps javapackages-tools-3.4.1-11.el7.noarch
rpm -e --nodeps tzdata-java-2016h-1.el7.noarch
rpm -e --nodeps tzdata-java-2016j-1.el7.noarch
rpm -e --nodeps python-javapackages-3.4.1-11.el7.noarch
mkdir /usr/java
mv jdk-8u121-linux-x64.tar.gz /usr/java/
cd /usr/java
tar -zxvf jdk-8u121-linux-x64.tar.gz
vi /etc/profile
在文件最后加上:
#set java environment
JAVA_HOME=/usr/java/jdk1.8.0_121
JRE_HOME=/usr/java/jdk1.8.0_121/jre
CLAS