Follow the below steps to install Oracle JDK from the latest tar file:
Download the latest tar file from here - Current latest is Java SE Development Kit 8u112.
You need sudo privilages:
sudo su
Create a dir for jdk install:
mkdir /opt/jdk
Extract downloaded tar into it:
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
Verify if the files are extracted:
ls /opt/jdk
Setting Oracle JDK as the default JVM:
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100
and
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100
Check Java version:
java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)