In this article, I am going to describe how to install java in Ubuntu 16.04 using the terminal.
First I am going to add Oracle's PPA(Personal Package Archive) using terminal command.
You can open terminal easily by pressing Ctrl + Alt + t
Then type and enter below code.
sudo add-apt-repository ppa:webupd8team/java
After that update your package repository using this terminal command.
sudo apt-get update