Install Oracle (Sun) Java 6 on Ubuntu

来源:互联网 发布:dnf红眼二觉技能数据 编辑:程序博客网 时间:2024/05/16 12:08

全文来自:https://help.ubuntu.com/community/Java

Oracle (Sun) Java 6

WARNING: Oracle Java 6 had reached its end of life in November 2012. There is at least one severe known vulnerability in this version, and since Java 6 is neither supported by Canonical nor Oracle, there may be many more! You should really not install this unless you have a specific need to do so. It is recommended that users either migrate to OpenJDK, or install Oracle Java 7.

Oracle (Sun) Java 6 is no longer available to be distributed by Ubuntu, because of license issues.

Deprecated information about the installation of Oracle Java 6:

JDK or JRE

Downloads the Java binary installers from Oracle, builds the .deb packages locally on your computer and then installs them.Packages are compatible with the “official” Ubuntu ones and will upgrade Java 6 that was previously installed from packages.

You can find the script and full usage instructions on github.

  • https://github.com/flexiondotorg/oab-java6

(since version 0.2.3 it also works with java 7 using -7 optional parameter).

Another instruction it works for Ubuntu 12.04.

  • http://superuser.com/questions/353983/how-do-i-install-the-sun-java-sdk-in-ubuntu-11-10-oneric

Manual method

  • oracle java 6 jre 32-bit

 $ wget http://download.oracle.com/otn-pub/java/jdk/6u34-b04/jre-6u34-linux-i586.bin $ chmod u+x jre-6u34-linux-i586.bin $ ./jre-6u34-linux-i586.bin $ sudo mkdir -p /usr/lib/jvm $ sudo mv jre1.6.0_34 /usr/lib/jvm/ $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.6.0_34/bin/java" 1 $ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jre1.6.0_34/lib/i386/libnpjp2.so" 1 $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.6.0_34/bin/javaws" 1

or

  • oracle java 6 jdk 32-bit

 $ wget http://download.oracle.com/otn-pub/java/jdk/6u34-b04/jdk-6u34-linux-i586.bin $ chmod u+x jdk-6u34-linux-i586.bin $ ./jdk-6u34-linux-i586.bin $ sudo mkdir -p /usr/lib/jvm $ sudo mv jdk1.6.0_34 /usr/lib/jvm/ $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_34/bin/java" 1 $ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_34/bin/javac" 1 $ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_34/jre/lib/i386/libnpjp2.so" 1 $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.6.0_34/bin/javaws" 1
  • IMPORTANT choose the java you installed as default

 $ sudo update-alternatives --config java $ sudo update-alternatives --config javac $ sudo update-alternatives --config mozilla-javaplugin.so $ sudo update-alternatives --config javaws

Choosing the default Java to use

If your system has more than one version of Java, configure which one your system uses by entering the following command in a terminal window

sudo update-alternatives --config java

This will present you with a selection that looks similar to the following (the details may differ for you):

There are 2 choices for the alternative java (providing /usr/bin/java).  Selection Path Priority Status ———————————————————— * 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode 1 /usr/lib/jvm/jre1.7.0/jre/bin/java 3 manual mode  Press enter to keep the current choice[*], or type selection number: 1

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 三年级语文太差怎么办 宝宝一年级很笨怎么办 一年级孩子太笨怎么办 孩子学习脑子笨怎么办 四年级孩子数学差怎么办 中考考不好了怎么办 初中没学高中怎么办 数学基础差该怎么办 三年级数学成绩差怎么办 夫妻差6岁怎么办 初一数学很差劲怎么办 三年级孩子成绩差怎么办 初中数学成绩不好怎么办 大人不会算数学怎么办 小学初数学不好怎么办 初中生数学计算能力差怎么办 初中生数学计算差怎么办 初一数学没救了怎么办 五年级英语不好怎么办 三年级孩子学习差怎么办 孩子三年级学习成绩差怎么办 三年级字写不好怎么办 7小孩表达能力差怎么办 孩子考了低分怎么办 初一考300分怎么办 小学三年级成绩不好怎么办 五年级考几分怎么办 思想晚熟的人怎么办 孩子学不好数学怎么办 做作业速度慢怎么办 孩子碎头发太多怎么办 孩子碎发太多怎么办 孩子的作业太多怎么办 爸爸是乙肝孩子怎么办 孩子出生没有奶怎么办 顺产后没有奶水怎么办 还在经常逃课怎么办 老板不重视自己怎么办 孩子不听话爱撒谎怎么办 老师针对我孩子怎么办 小孩动不动就哭怎么办