Install Oracle Java JDK 7 on Ubuntu 12.04 64bit

Here are commands to type one after the other in order to install Oracle Java on a machine running 64bit Ubuntu 12 [or higher].

Java is required for just about most things on the web, Cisco anyconnect, Android development using Eclipse etc.

Click here for the download link for Oracle Java

Commands:

tar -xvf jdk-7u5-linux-x64.tar.gz
cd Downloads
sudo mkdir -p /usr/lib/jvm/jdk1.7.0
sudo mv jdk1.7.0_05/* /usr/lib/jvm/jdk1.7.0/
sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.7.0/bin/java” 1
sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.7.0/bin/javac” 1
sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/lib/jvm/jdk1.7.0/bin/javaws” 1
mkdir ~/.mozilla/plugins/
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

 

For 32bit machines, replace amd64 with i386

 

 

Leave a Reply