Declare Oracle Java 8 Repository :
sudo add-apt-repository ppa:webupd8team/java
Then, refresh local repository index :
Then, refresh local repository index :
sudo apt-get update
And install with :
And install with :
sudo apt-get install oracle-java8-installer
Source : https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04