[root@localhost ~]# java -version java version "1.7.0_131" OpenJDK Runtime Environment (rhel-2.6.9.0.el6_8-x86_64 u131-b00) OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)
[root@localhost ~]# rpm -qa|grep java java-1.7.0-openjdk-1.7.0.131-2.6.9.0.el6_8.x86_64 tzdata-java-2016j-1.el6.noarch java-1.6.0-openjdk-1.6.0.41-1.13.13.1.el6_8.x86_64
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.131-2.6.9.0.el6_8.x86_64 [root@localhost ~]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.41-1.13.13.1.el6_8.x86_64 [root@localhost ~]# rpm -e --nodeps tzdata-java-2016j-1.el6.noarch
而後再查看/usr/lib/jvm 下,如今爲空的,已經卸載乾淨。java
[root@ localhost ~]# tar xvf jdk-8u191-linux-x64.tar.gz -C /usr/local/
node
[root@localhost ~]# cd /usr/local/ [root@ localhost local]# ln -s jdk1.8.0_191 java
[root@ localhost local]# vim /etc/profile
文件末尾添加以下內容:linux
export JAVA_HOME=/usr/local/java export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar export PATH=$JAVA_HOME/bin:$PATH
保存退出,使配置生效:[root@ bogon jdk1.8.0_191]# source /etc/profile
vim
[root@localhost local]# java -version java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)