CentOS下安装java JDK以及错误解决

1. 执行安装: rpm -i jdk-7u67-linux-i586.rpm, 报错如下:

[root@localhost tmp]# rpm -i jdk-7u67-linux-i586.rpm 
Unpacking JAR files...
rt.jar...
/usr/java/jdk1.7.0_67/bin/unpack200: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
Error: unpack could not create JAR file:


/usr/java/jdk1.7.0_67/jre/lib/rt.jar


Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
jsse.jar...
/usr/java/jdk1.7.0_67/bin/unpack200: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
Error: unpack could not create JAR file:


/usr/java/jdk1.7.0_67/jre/lib/jsse.jar

<以下省略多种类似错误>


或者如果安装后出现如下错误:

[maomao@localhost Desktop]$ java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object


2. 安装缺失的文件: yum install libgcc_s.so.1

3. 再次执行安装: rpm -i jdk-7u67-linux-i586.rpm

[root@localhost tmp]# rpm -i jdk-7u67-linux-i586.rpm 
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar...
plugin.jar...
javaws.jar...
deploy.jar...


我使用的系统为CentOS. 最后JAVA成功安装~~~~




你可能感兴趣的:(Linux)