日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

从JDK 6升级到JDK 7过程中遇到的一个问题

發布時間:2024/8/1 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 从JDK 6升级到JDK 7过程中遇到的一个问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

先前系統上有JDK 6的安裝,由于要部署Facebook的Presto做一些測試,需要將其升級到JDK 7,但是在安裝的過程中遇到以下的問題:


[root@x01 data2]# rpm -ivh --force --replacepkgs jdk-7u45-linux-x64.rpm Preparing... ########################################### [100%]1:jdk ########################################### [100%] Unpacking JAR files...rt.jar... Error: Could not open input file: /usr/java/jdk1.7.0_45/jre/lib/rt.pack Error: unpack could not create JAR file:/usr/java/jdk1.7.0_45/jre/lib/rt.jarPlease refer to the Troubleshooting section of the Installation Instructions on the download page.jsse.jar... Error: Could not open input file: /usr/java/jdk1.7.0_45/jre/lib/jsse.pack Error: unpack could not create JAR file:/usr/java/jdk1.7.0_45/jre/lib/jsse.jarPlease refer to the Troubleshooting section of the Installation Instructions on the download page.charsets.jar... Error: Could not open input file: /usr/java/jdk1.7.0_45/jre/lib/charsets.pack Error: unpack could not create JAR file:/usr/java/jdk1.7.0_45/jre/lib/charsets.jarPlease refer to the Troubleshooting section of the Installation Instructions on the download page.tools.jar... Error: Could not open input file: /usr/java/jdk1.7.0_45/lib/tools.pack Error: unpack could not create JAR file:/usr/java/jdk1.7.0_45/lib/tools.jarPlease refer to the Troubleshooting section of the Installation Instructions on the download page.localedata.jar... Error: Could not open input file: /usr/java/jdk1.7.0_45/jre/lib/ext/localedata.pack Error: unpack could not create JAR file:/usr/java/jdk1.7.0_45/jre/lib/ext/localedata.jarPlease refer to the Troubleshooting section of the Installation Instructions on the download page.jfxrt.jar... Error: Could not open input file: /usr/java/jdk1.7.0_45/jre/lib/jfxrt.pack Error: unpack could not create JAR file:/usr/java/jdk1.7.0_45/jre/lib/jfxrt.jarPlease refer to the Troubleshooting section of the Installation Instructions on the download page.
如果在這種情況下,我們查看Java的版本,會報出以下的錯誤:

[root@x01 data2]# java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
最終的解決辦法,是清理掉系統殘留的舊版本的相關的安裝:

[root@x01 data2]# rpm -qa | grep jdk jdk-1.7.0_45-fcs.x86_64 [root@x01 data2]# rpm -e jdk-1.7.0_45-fcs.x86_64 [root@x01 data2]# rpm -qa | grep jdk [root@x01 data2]# rpm -qa | grep java sun-javadb-core-10.6.2-1.1.i386 sun-javadb-javadoc-10.6.2-1.1.i386 sun-javadb-common-10.6.2-1.1.i386 sun-javadb-client-10.6.2-1.1.i386 sun-javadb-docs-10.6.2-1.1.i386 sun-javadb-demo-10.6.2-1.1.i386 [root@x01 data2]# rpm -e sun-javadb-* error: package sun-javadb-* is not installed [root@x01 data2]# rpm -e sun-javadb-core-10.6.2-1.1.i386 sun-javadb-javadoc-10.6.2-1.1.i386 sun-javadb-common-10.6.2-1.1.i386 sun-javadb-client-10.6.2-1.1.i386 sun-javadb-docs-10.6.2-1.1.i386 sun-javadb-demo-10.6.2-1.1.i386 [root@x01 data2]# rpm -qa | grep java [root@x01 data2]# rpm -qa | grep jre [root@x01 data2]# rpm -qa | grep java [root@x01 data2]# rpm -qa | grep jdk
這樣之后,再運行先前的安裝程序即可:

[root@x01 data2]# rpm -ivh jdk-7u45-linux-x64.rpm Preparing... ########################################### [100%]1:jdk ########################################### [100%] Unpacking JAR files...rt.jar...jsse.jar...charsets.jar...tools.jar...localedata.jar...jfxrt.jar... [root@x01 data2]# source /etc/profile [root@x01 data2]# java -version java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) [root@x01 data2]#
Done!

總結

以上是生活随笔為你收集整理的从JDK 6升级到JDK 7过程中遇到的一个问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。