step1: download the javaSE jdk-8u11-linux-x64.tar.gz
step2: open the terminal and unzip the tar file
$ tar -zxvf jdk-8u101-linux-x64.tar.gz
step3: copy the unzip folder to usr/lib/java,
$ cd /usr/lib
$ sudo mkdir java
$ cd ~/home/user/Downloads
$ sudo mv jdk1.8.0_101/ /usr/lib/java
$ cd /usr/java/java1.8.0_101/bin
step4: Run the below commands
sudo update-alternatives --install "/usr/bin/java"
"java" "/usr/lib/java/jdk1.8.0_101/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac"
"javac" "/usr/lib/java/jdk1.8.0_101/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws"
"javaws" "/usr/lib/java/jdk1.8.0_101/bin/javaws" 1
step5: update the JAVA_HOME in your ~/.bashrc
#JAVA HOME directory setup
export JAVA_HOME=/usr/lib/java/jdk1.8.0_101
export PATH="$PATH:$JAVA_HOME/bin"
VERIFY: $ java -version
jdk1.8.0_101 version
$ echo $JAVA_HOME
/usr/lib/java/jdk1.8.0_101