I am on UBUNTU. JDK version currently installed is:
java version \"1.7.0_51\" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Se
Just use these command lines:
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
If needed, you can also follow this Ubuntu tutorial.