一、查看是否已安裝JDK,卸載java
yum list installed |grep java python
java-1.8.0-openjdk.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-accessibility.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-accessibility-debug.x86_64 java-1.8.0-openjdk-debug.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-demo.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-demo-debug.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-devel.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-devel-debug.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-headless.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-headless-debug.x86_64 java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-javadoc-debug.noarch 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-javadoc-zip.noarch 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-javadoc-zip-debug.noarch java-1.8.0-openjdk-src.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-1.8.0-openjdk-src-debug.x86_64 1:1.8.0.181-3.b13.el7_5 @updates java-atk-wrapper.x86_64 0.30.4-5.el7 @base javapackages-tools.noarch 3.4.1-11.el7 @base python-javapackages.noarch 3.4.1-11.el7 @base tzdata-java.noarch 2018e-3.el7 @updates
二、卸載Java環境app
yum -y remove java-1.8.0-openjdk* ---表時卸載全部openjdk相關文件輸入 less
yum -y remove tzdata-java.noarch ----卸載tzdata-java spa
三、安裝JDKdebug
yum -y list java* ---查看JDK安裝包列表code
yum -y install java-1.8.0-openjdk* ---安裝1.8.0blog