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.
(Since version 0.2.3 It also works with Java 7 using-7 optional parameter ).
Another instruction it works for Ubuntu 12.04.
Manual method
$ 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
$ 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
$ 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