Simple Way To Install Oracles Java On Ubuntu

The latest linux version of the Java SDK from oracle is available as a .rpm package.

But alas, Ubuntu doesn't do rpm package installations. However, you can convert the latest .rpm file to a .deb file, which Ubunto DOES support.

Step 1 Install rpm and alien:

Go to the Ubutu software center and search for rpm, and select the rpm and click the alien addon

Step 2

copy the .rpm to your home folder

Step 3

Open terminal and type (for 32 bit Ubuntu):

sudo alien --scripts jdk-7u6-linux-i586.rpm

or for 64 bit Ubuntu, type:

sudo alien --scripts jdk-7u6-linux-amd64.rpm

(replace the 7u6 with whatever version is current at Oracle)

Step 4

The last step takes about a minute, and makes a file that ends with .deb. Open the .deb file in your home folder to install java (It should open up the "Ubuntu Software Center")

Step 5: confirm installation:

In terminal type: javac -version and you should see "javac 1.7.0_06" if all is well.

This method minimizes the terminal commands, and takes advantages to the ubuntu 12.04 interface as much as possible.

Warning:BlueJ deb installs IcedTea Java 6

The BlueJ deb package will overwrite the oracle jdk with IcedTea Open Java... so be warned.

Another way to go

You can forgo all this and depend upon others, using a PPA from http://ppa.webupd8.org/:

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