Install Oracle Java 8 in Ubuntu 12.04

To get started, press Ctrl – Alt – T on your keyboard to open the terminal. When it opens, run the commands below to add the required PPA.

sudo add-apt-repository ppa:webupd8team/java

Update run the following command:

sudo apt-get update

Finally, run the commands below to update your system and install Java.

sudo apt-get install oracle-java8-installer

To verify if Java is installed, run the commands below.

java –version

To remove java8 run the following command:

sudo apt-get remove oracle-java8-installer