[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 下,現(xiàn)在為空的,已經(jīng)卸載干凈。
創(chuàng)新互聯(lián)建站主要從事成都網(wǎng)站建設(shè)、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)遵化,十載網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來(lái)電咨詢建站服務(wù):18980820575
[root@ localhost ~]# tar xvf jdk-8u191-linux-x64.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/
[root@ localhost local]# ln -s jdk1.8.0_191 java
[root@ localhost local]# vim /etc/profile
文件末尾添加如下內(nèi)容:
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
[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)