Debian

從 Oracle 安裝 Java 6 到 Debian Lenny

  • June 10, 2018

由於 Java 6 在 Debian 5 中不可用,我決定從 Oracle 那裡獲取它。我已經在文件 jdk-6u45-linux-i586-rpm.bin 中下載了 Java 6 SDK。但是如何安裝呢?

我執行jdk-6u45-linux-i586-rpm.bin並得到了幾個文件:

jdk-6u45-linux-i586.rpm                
sun-javadb-core-10.6.2-1.1.i386.rpm
sun-javadb-demo-10.6.2-1.1.i386.rpm
sun-javadb-docs-10.6.2-1.1.i386.rpm
sun-javadb-javadoc-10.6.2-1.1.i386.rpm
sun-javadb-client-10.6.2-1.1.i386.rpm

我接下來應該做什麼?

UPD

執行後:

rpm -ivh jdk-6u45-linux-i586.rpm sun-javadb-core-10.6.2-1.1.i386.rpm sun-javadb-demo-10.6.2-1.1.i386.rpm sun-javadb-docs-10.6.2-1.1.i386.rpm sun-javadb-javadoc-10.6.2-1.1.i386.rpm sun-javadb-client-10.6.2-1.1.i386.rpm

得到輸出:

/bin/basename is needed by jdk-1.6.0_45-fcs.i586
/bin/cat is needed by jdk-1.6.0_45-fcs.i586
/bin/cp is needed by jdk-1.6.0_45-fcs.i586
/bin/gawk is needed by jdk-1.6.0_45-fcs.i586
/bin/grep is needed by jdk-1.6.0_45-fcs.i586
/bin/ln is needed by jdk-1.6.0_45-fcs.i586
/bin/ls is needed by jdk-1.6.0_45-fcs.i586
/bin/mkdir is needed by jdk-1.6.0_45-fcs.i586
/bin/mv is needed by jdk-1.6.0_45-fcs.i586
/bin/pwd is needed by jdk-1.6.0_45-fcs.i586
/bin/rm is needed by jdk-1.6.0_45-fcs.i586
/bin/sed is needed by jdk-1.6.0_45-fcs.i586
/bin/sort is needed by jdk-1.6.0_45-fcs.i586
/bin/touch is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/cut is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/dirname is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/expr is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/find is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/tail is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/tr is needed by jdk-1.6.0_45-fcs.i586
/usr/bin/wc is needed by jdk-1.6.0_45-fcs.i586
/bin/sh is needed by jdk-1.6.0_45-fcs.i586
sun-javadb-common is needed by sun-javadb-core-10.6.2-1.1.i386
/bin/sh is needed by sun-javadb-core-10.6.2-1.1.i386
sun-javadb-common is needed by sun-javadb-demo-10.6.2-1.1.i386
sun-javadb-common is needed by sun-javadb-docs-10.6.2-1.1.i386
sun-javadb-common is needed by sun-javadb-javadoc-10.6.2-1.1.i386
sun-javadb-common is needed by sun-javadb-client-10.6.2-1.1.i386

安裝 Oracle 的 Java 6 JDK 的最佳方法是按以下步驟進行:

  • 安裝java-package
apt-get install java-package
  • 從Oracle 檔案下載jdk-6u45-linux-i586.bin不是RPM);
  • 創建相應的 Debian 軟體包:
make-jpkg jdk-6u45-linux-i586.bin
  • 安裝生成的包:
sudo dpkg -i oracle-java6-jdk_6u45_i386.deb

這將負責設置替代方案等,以便您可以完全替換任何已安裝的 JVM。如果要保持安裝多個 JVM,請使用update-java-alternatives選擇預設 JVM。

引用自:https://unix.stackexchange.com/questions/448904