Install Oracle Java 7 JDK 7 in Ubuntu 12.04

I faced some problem to install Oracle Java JDK installing on ubuntu 12.04 . here is a solution I found and it’s worked for me.

Here is step by step instruction  of install Java Runtime .

Open Terminal. Then,  run the commands below to remove all other installations of OpenJDK from your system.

sudo apt-get purge openjdk*

Then, go and download Java JDK package from here.

Run the below commands to extract the java packages you downloaded.

tar -xvf ~/Downloads/jdk-7u3-linux-i586.tar.gz

Now create your java  folder by running the commands below.

sudo mkdir -p /usr/lib/jvm/jdk1.7.0

Now run this command for move all the extracted files and folders into the java  folder.

sudo mv jdk1.7.0_03/* /usr/lib/jvm/jdk1.7.0/

Next, run those commands as shown below one-at-a-time to enable Java JDK. Remember to press Enter after each line.

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

That’s it.

Advertisements

One thought on “Install Oracle Java 7 JDK 7 in Ubuntu 12.04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s