Download Oracle JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Accept License Agreement and download the corresponding .tar.gz file, jdk-8u11-linux-i586.tar.gz in my case.
Unpack the downloaded tarball (.tar.gz) and move unpacked folder to where you want, /home/u/jdk1.8.0_11/ in my case.
Run the following commands in terminal to update the alternatives of javac and java. Where /home/u/jdk1.8.0_11/ is the installed folder of jdk.
$ sudo update-alternatives --install /usr/bin/javac javac /home/u/jdk1.8.0_11/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /home/u/jdk1.8.0_11/bin/java 1
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
After installed and setup |
Step-by-step: