从JDK 6升级到JDK 7过程中遇到的一个问题(卸载rpm)
2016-06-09 22:16
513 查看
先前系统上有JDK 6的安装,由于要部署Facebook的Presto做一些测试,需要将其升级到JDK 7,但是在安装的过程中遇到以下的问题:
[plain] view
plain copy
[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.jar
Please 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.jar
Please 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.jar
Please 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.jar
Please 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.jar
Please 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.jar
Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
如果在这种情况下,我们查看Java的版本,会报出以下的错误:
[plain] view
plain copy
[root@x01 data2]# java -version
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
最终的解决办法,是清理掉系统残留的旧版本的相关的安装:
[plain] view
plain copy
[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
这样之后,再运行先前的安装程序即可:
[plain] view
plain copy
[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]#
[plain] view
plain copy
[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.jar
Please 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.jar
Please 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.jar
Please 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.jar
Please 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.jar
Please 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.jar
Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
如果在这种情况下,我们查看Java的版本,会报出以下的错误:
[plain] view
plain copy
[root@x01 data2]# java -version
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
最终的解决办法,是清理掉系统残留的旧版本的相关的安装:
[plain] view
plain copy
[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
这样之后,再运行先前的安装程序即可:
[plain] view
plain copy
[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]#
相关文章推荐
- Android Manifest 用法
- android wifi 无线调试
- 什么是 GraphQL?
- Spark RDD API详解(一) Map和Reduce
- 运维入门
- 动态清空 nohup 输出文件
- install scrapy with pip and easy_install
- Spring Boot 开发微服务
- 我是运营,我没有假期
- Linux Shell常用技巧
- Shell 脚本编程陷阱
- lwn拾遗:[sn3218 led drivers]-api解释-1
- 页面元素查找之Selectors API
- DB2数据库的安装
- 一个小型js框架myJSFrame附API使用帮助
- C#实现把指定数据写入串口
- “传奇”图象数据存储方式
- 详细分析交换机、路由器、集线器的区别和联系
- PowerShell打开或关闭光驱
- shell字符串操作详解