Install Oracle (Sun) Java 6 on Ubuntu

Source: Internet
Author: User

Full text from: 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 more! You shoshould 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 installthem.
Packages are compatible with the "official" Ubuntu ones and will upgrade Java 6 that was previusly 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

    • ImportantChoose 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 Mode1/usr/lib/JVM/jre1.7.0/JRE/bin/Java 3 manual modePress enter to keep the current choice [*], or type selection number: 1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.