Xubuntu and Ubuntu both have OpenJDK pre-installed but I want Sun Java 7 for work purpose…
While there are so many ways to do it, I installed it using the PPA.
1) Remove the OpenJDK (optional – I like to remove stuff I don’t need)
Fire up the Terminal:
sudo apt-get purge openjdk*
2) Add the ppa
sudo add-apt-repository ppa:webupd8team/java
3) sudo apt-get update
Update apt-get with the new PPA
4) Install Java 7
sudo apt-get install oracle-java7-installer
Accept whatever and get a cup of coffee
5) Doublecheck my Java version
java -version