Just a quick refresher on installation of Java 7 on Ubuntu (*buntu)
$ sudo apt-get install python-software-properties software-properties-common
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
$ sudo apt-get install oracle-java7-set-default
$ sudo update-alternatives –config java
Similarly, Java 8 can be install via:
$ sudo apt-get install oracle-java8-installer
$ sudo apt-get install oracle-java8-set-default
Versions of Java currently includes 6 / 7 /8 / 9 on the repository which can be found at : https://launchpad.net/~webupd8team/+archive/ubuntu/java
For the openjdk versions, you can simply install via:
$ sudo apt-get install openjdk-8-jre