Download the JRE from Oracle website.
Then perform the following steps (adjust the tar.gz filename according to what you downloaded, and replace “jre1.8.0_40” with the directory of your extracted tar.gz):
cd /opt sudo tar xvzf ~/Downloads/jre-8u40-linux-x64.tar.gz sudo chown -R root.root jre1.8.0_40 sudo ln -s jre1.8.0_40 jre sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jre/lib/amd64/libnpjp2.so 1000 sudo update-alternatives --set mozilla-javaplugin.so /opt/jre/lib/amd64/libnpjp2.so