CentOS 6 删除自带 OpenJDK 1.8
查看系统自带OpenJDK
[root@CentOS-6-A ~]# rpm -qa | grep java tzdata-java-2018e-3.el6.noarch java-1.6.0-openjdk-1.6.0.41-1.13.13.1.el6_8.x86_64 java-1.7.0-openjdk-1.7.0.181-2.6.14.10.el6.x86_64
删除上述的2个包文件
yum -y remove java-1.6.0-openjdk-1.6.0.41-1.13.13.1.el6_8.x86_64 yum -y remove java-1.7.0-openjdk-1.7.0.181-2.6.14.10.el6.x86_64
安装自己下载的 Oracle JDK
CentOS 7 删除自带 OpenJDK 1.8
查看系统自带OpenJDK
[root@jianbao-pc ~]# rpm -qa | grep java java-1.8.0-openjdk-headless-1.8.0.222.b03-1.el7.x86_64 python-javapackages-3.4.1-11.el7.noarch tzdata-java-2019b-1.el7.noarch java-1.7.0-openjdk-headless-1.7.0.221-2.6.18.1.el7.x86_64 javapackages-tools-3.4.1-11.el7.noarch java-1.8.0-openjdk-1.8.0.222.b03-1.el7.x86_64 java-1.7.0-openjdk-1.7.0.221-2.6.18.1.el7.x86_64
删除上述的2个包文件
yum -y remove java-1.8.0-openjdk-headless-1.8.0.222.b03-1.el7.x86_64 yum -y remove java-1.7.0-openjdk-headless-1.7.0.221-2.6.18.1.el7.x86_64
安装自己下载的 Oracle JDK