Category Archives: java

How to install Java 6 Manually on ubuntu 12.04/12.10

There are many applications, which still require java 6, this tutorial is how to uninstall existing java  and install java 6.

You will find many methods to install java / jre/ jvm on web and thus it can be very much confusing to a user which method to use. Given there are many implementations of Java available, adds to the confusion. The different implementations of JDK available are:

  1. Java from Oracle (earlier provided by Sun which has been acquired by Oracle
  2. Java available from IBM
  3. OpenJDK
  4. GNU’s JDK

There is a possibility that already java may installed on your system,

Please check with the following commands,

Java –version

dpkg –list | grep jdk

dpkg –list | grep jre

Remove OpenJDK

Command: “sudo apt-get purge openjdk-\*

Download the jdk binary from oracles website and follow the steps below:

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/jre1.6.0_30/bin/java” 1

sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/jre1.6.0_30/bin/javac” 1

sudo update-alternatives –install “/usr/lib/mozilla/plugins/libjavaplugin.so” “mozilla-javaplugin.so” “/usr/lib/jvm/jre1.6.0_30/lib/amd64/libnpjp2.so” 1

“sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/local/java/jdk1.6.0_45/bin/javaws” 1″

vim /etc/profile

JAVA_HOME=/usr/lib/jvm/jre1.6.0_30/
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/lib/jvm/jre1.6.0_30/
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

Reload profile

./etc/profile

Now check

java -version
java version “1.6.0_30″
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Login to browser,

http://javatester.org/

check ur java version,

if u see error like browser has java disabled, then follow this,

For Firefox,
Open Tools/Add-ons/Plugins (Keyboard shortcut is Shift+Ctrl+A) and find it on the list. Click the ‘Disable’ button to the right of it to disable the plugin. (Note that I’ve never bothered installing it so it’s not present in my screenshot. If you have it installed you will see it here.)

FF plugins