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 an 503 error occured, you are so bad luck because of restrictred 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.