Currently, java stable version is 8.
To install it do these steps:
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
If a 503 error occurred, you are so bad luck because of restricted countries:
So you must proxy your aptitude. edit /etc/apt/apt.conf file and add these lines:
Acquire::http::Proxy "your-proxy-url"; Acquire::https::Proxy "your-proxy-url";
Fill with your correct proxy URL. then do install steps again.