How do I install the Sun Java Development Kit (JDK 7)?

How to install JDK 7 on Ubuntu?

The installation should be with the tar archive.

I know the basic installation with the bin, but how to do with only a tar archive?


If you like the easy way you can use webupd8 java ppa, then there is no of installing it by the tar file:

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

http://www.webupd8.org/2013/06/oracle-releases-java-7-update-25-7u25.html

Alter Install you can change the default java-version by

sudo update-alternatives --config java