How to install Java 8 on ubuntu 15.04/14.10/14.04 using PPA
In addition to the language changes, much more dramatic changes have been made to the Java Class Library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5. Entire new APIs, such as Swing and Java2D, have been introduced, and many of the original JDK 1.0 classes and methods have been deprecated. Some programs allow conversion of Java programs from one version of the Java platform to an older one (for example Java 5.0 backported to 1.4) (see Java backporting tools).
After the Java 7 release, Oracle promised to go back to a 2 year release cycle. However, in 2013, Oracle announced that they would delay Java 8 by one year, in order to improve the Java security model.
Install Java 8 on ubuntu 15.04/14.10/14.04 using PPA
First you need to remove any existing java versions i.e openjdk using the follwoing command
sudo apt-get purge openjdk*
Now you need to run the following commands to install java 8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
You can check the java version using the following command
If you want to switch between java versions run the following command from your terminal
sudo update-alternatives --config java