1. 程式人生 > >centos中安裝jdk步驟,且顯示Error: unpack could not create JAR file:

centos中安裝jdk步驟,且顯示Error: unpack could not create JAR file:

安裝jdk步驟:

1.1解除安裝系統自帶的openjdk
[[email protected] ~]# rpm -qa | grep java
[[email protected] ~]# yum -y remove *openjdk*

1.2下載、安裝
在Oracle官網http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html找到我們需要的JDK版本,下載對應的rpm包後上傳到伺服器,然後進行安裝:

[[email protected] ~]# rpm -ivh jdk-8u162-linux-x64.rpm

1.3配置環境變數
[

[email protected] ~]# vim /etc/profile 

在檔案後面新增如下配置

JAVA_HOME=/usr/java/jdk1.8.0_162
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

儲存並退出
重新整理修改後的配置檔案

[[email protected] ~]# source /etc/profile

1.4檢查是否安裝成功
[[email protected]

~]# java -version
[[email protected] ~]# java
[[email protected] ~]# javac
--------------------- 
作者:ZHU_WD 
來源:CSDN 
原文:https://blog.csdn.net/zhu815496402/article/details/80357400 
版權宣告:本文為博主原創文章,轉載請附上博文連結!

 

 

[[email protected] ~]# rpm -ivh jdk-7u55-linux-i586.rpm 
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
        rt.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

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

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        jsse.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

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

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        charsets.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/jre/lib/charsets.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        tools.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/lib/tools.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        localedata.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/jre/lib/ext/localedata.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        jfxrt.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/jre/lib/jfxrt.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        plugin.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/jre/lib/plugin.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        javaws.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/jre/lib/javaws.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
        deploy.jar...
/var/tmp/rpm-tmp.dTi5eF: /usr/java/jdk1.7.0_55/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個檔案或目錄
Error: unpack could not create JAR file:

        /usr/java/jdk1.7.0_55/jre/lib/deploy.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.

 

原因
64位系統中安裝了32位程式。

解決方法
執行以下命令:
[[email protected] ~]# yum install libgcc.i686

[[email protected] ~]# yum install ld-linux.so.2

再重新安裝JDK