Install Java on Ubuntu

The eas­i­est way to install Ora­cle Java 8 is to run the fol­low­ing com­mands from the terminal.

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

Ver­ify the installed Java ver­sion using the following :

$ java -version

It should out­put some­thing like the following :

java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

You may also like...