The Script way
wget
friendly.Before using this make sure that this script is in the same directory as the
.tar.gz
file extension that you downloaded and there are no
files that start with jdk-7 in the same folder. If there are, please
move them out of the folder temporarily. Remember to make the script
executable (chmod +x <script's file>
).If you want to install the plugin for Firefox then add this to the end of the script:#!/bin/sh tar -xvf jdk1.8* #Change by the you downloaded from oracle sudo mkdir /usr/lib/jvm sudo mv ./jdk1.7* /usr/lib/jvm/jdk1.7.0 sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdkx.y.z/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk
x.y.z
/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk
x.y.z
/bin/javaws" 1 sudo chmod a+x /usr/bin/java sudo chmod a+x /usr/bin/javac sudo chmod a+x /usr/bin/javaws
mkdir ~/.mozilla/plugins
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
sudo /etc/init.d/apparmor restart