疯中凌乱的少年 發表於 2024-8-21 00:00:00

CentOS如何卸载系统的OpenJDK

<p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        安装好的CentOS会自带OpenJdk,用命令&nbsp;Java&nbsp;-version ,会有下面的信息:</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        java version &quot;1.6.0&quot;</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        OpenJDK&nbsp; Runtime Environment (build 1.6.0-b09)</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        最好还是先卸载掉openjdk,在安装sun公司的jdk.</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        先查看 rpm -qa | grep java</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><strong>显示如下信息:</strong></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        java-1.4.2-gcj-compat-1.4.2.0-40jpp.115</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><strong>卸载:</strong></p><pre class="brush:bash;toolbar:false">rpm&nbsp;-e&nbsp;--nodeps&nbsp;java-1.4.2-gcj-compat-1.4.2.0-40jpp.115</pre><pre class="brush:bash;toolbar:false">rpm&nbsp;-e&nbsp;--nodeps&nbsp;java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5</pre><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><strong>还有一些其他的命令</strong></p><pre class="brush:bash;toolbar:false">rpm&nbsp;-qa&nbsp;|&nbsp;grep&nbsp;gcj</pre><pre class="brush:bash;toolbar:false">rpm&nbsp;-qa&nbsp;|&nbsp;grep&nbsp;jdk</pre><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        如果出现找不到openjdk source的话,那么还可以这样卸载</p><pre class="brush:bash;toolbar:false">yum&nbsp;-y&nbsp;remove&nbsp;java&nbsp;java-1.4.2-gcj-compat-1.4.2.0-40jpp.115</pre><pre class="brush:bash;toolbar:false">yum&nbsp;-y&nbsp;remove&nbsp;java&nbsp;java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5</pre><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><br/></p>
頁: [1]
查看完整版本: CentOS如何卸载系统的OpenJDK