Dear Gaurav,

Hope you are doing well.

Please follow below steps

1. Download Oracle Java from below link

2.  Extract the tar ball
tar -xvf jdk-7u79-linux-x64.tar.gz
3. Make directory java under /usr/lib and move extracted package into java directory
mkdir /usr/lib/java
sudo mv jdk-7u-....  /usr/lib/java
4. Open and edit .bashrc file and give the Java installation path

sudo gedit .bashrc

5. Now set  Java Home variable

Please try the same and let me know if the issue persist.