Linux

在 CentOS 6 上安裝 Java EE 6

  • April 22, 2013

在 CentOS 6 x32 中安裝 Java EE 6 時遇到問題。

我已經刪除了所有以前版本的 Java 並臨時新安裝了 jdk1.6.0_34。

所以我的 $PATH 變數轉到:

/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/jdk1.6.0_34/bin/

一切似乎都很好執行:

$$ root@localhost opt $$# ./java_ee_sdk-6u4-jdk7-linux.sh

但它會吐出以下錯誤:

Extracting the installer archive...
java.util.zip.ZipException: invalid entry size (expected 3807229 but got 66969 bytes)
       at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:386)
       at java.util.zip.ZipInputStream.read(ZipInputStream.java:156)
       at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:100)
       at sun.tools.jar.Main.extractFile(Main.java:934)
       at sun.tools.jar.Main.extract(Main.java:850)
       at sun.tools.jar.Main.run(Main.java:240)
       at sun.tools.jar.Main.main(Main.java:1147)
Extracting the installer runtime...
java.io.EOFException: Unexpected end of ZLIB input stream
       at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:223)
       at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
       at java.util.zip.ZipInputStream.read(ZipInputStream.java:154)
       at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:100)
       at sun.tools.jar.Main.extractFile(Main.java:934)
       at sun.tools.jar.Main.extract(Main.java:850)
       at sun.tools.jar.Main.run(Main.java:240)
       at sun.tools.jar.Main.main(Main.java:1147)
Extracting the installer resources...
java.io.FileNotFoundException: ./Product/Packages/Resources.zip (No such file or directory)
       at java.io.FileInputStream.open(Native Method)
       at java.io.FileInputStream.<init>(FileInputStream.java:120)
       at java.io.FileInputStream.<init>(FileInputStream.java:79)
       at sun.tools.jar.Main.run(Main.java:236)
       at sun.tools.jar.Main.main(Main.java:1147)
Extracting the installer metadata...
java.io.FileNotFoundException: ./Product/Packages/metadata.zip (No such file or directory)
       at java.io.FileInputStream.open(Native Method)
       at java.io.FileInputStream.<init>(FileInputStream.java:120)
       at java.io.FileInputStream.<init>(FileInputStream.java:79)
       at sun.tools.jar.Main.run(Main.java:236)
       at sun.tools.jar.Main.main(Main.java:1147)
chmod: cannot access `product-installer.sh': No such file or directory
sh: product-installer.sh: No such file or directory

校驗和:

[root@localhost opt]# md5sum java_ee_sdk-6u4-jdk7-linux.sh
9299039e3daefff779875721ec8288c3  java_ee_sdk-6u4-jdk7-linux.sh

原因是 WinSCP 的錯誤(從我的 Windows PC 轉移到 Linux),轉移了許多文件並更改了校驗和……

更改為 Filezilla 並且校驗和匹配。

我從 oracle 網站下載了相同的文件,它的 md5sum 是——

[chida@localhost Downloads]$ md5sum java_ee_sdk-6u4-jdk7-linux.sh
2a79c24baed38f847def9c4e3398b40a  java_ee_sdk-6u4-jdk7-linux.sh

我在我的 64 位 Fedora 17 上執行了安裝程序腳本,它執行良好並打開了圖形安裝程序。

一定要驗證校驗和是否與我的匹配,否則它是別的東西。

我相信預設情況下,winscp 會以 ascii 模式傳輸 .sh 文件,因此存在您的問題。

引用自:https://serverfault.com/questions/419743