Centos7删除自带JDK1.8

xiaoxiao2021-02-28  6

一些开发版的centos会自带jdk,我们一般用自己的jdk,把自带的删除。 1.先看看有没有安装:

java -version [root@java-test-01 ~]# java -version openjdk version "1.8.0_101" OpenJDK Runtime Environment (build 1.8.0_101-b13) OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)

2.查找他们的安装位置

[root@java-test-01 ~]# rpm -qa | grep java java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64 tzdata-java-2016f-1.el7.noarch java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64 javapackages-tools-3.4.1-11.el7.noarch java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.2.el7_2.x86_64 java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64 python-javapackages-3.4.1-11.el7.noarch

3.删除全部,noarch文件可以不用删除

[root@java-test-01 ~]# rpm -qa | grep java java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64 tzdata-java-2016f-1.el7.noarch java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64 javapackages-tools-3.4.1-11.el7.noarch java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.2.el7_2.x86_64 java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64 python-javapackages-3.4.1-11.el7.noarch

4.删除全部,noarch文件可以不用删除

[root@java-test-01 ~]# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64 [root@java-test-01 ~]# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64 [root@java-test-01 ~]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.2.el7_2.x86_64 [root@java-test-01 ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64

5.检查有没有删除 如果还没有删除,则用yum -y remove去删除他们

本文转自centos7删除自带openjdk

转载请注明原文地址: https://www.6miu.com/read-200202.html

最新回复(0)