Saturday, 26 January 2013

The easiest way to install JDK on Ubuntu


The best way to install JDK 7 on Ubuntu 12.04


This article is written based on what I have read on http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html. Great article!

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

That's all you need to do.

Webupd8team provides the ppa that install and update Java automatically. It also sets the path and classpath appropriately. You don't need to set them up yourself. See my other article to set up the path and classpath (Installing JDK on Ubuntu 11.10).

To check if it's installed properly:

>sudo javac-version


>sudo java -version

The expected result should be like here:



To uninstall the JDK 7:

sudo apt-get remove oracle-java7-installer