# 1. Use a PROXY and go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and accept the terms then download the tar.gz suitable to your system (32 or 64 bit). # 2. Move that .tar.gz tarball to the Downloads directory in your home folder. # 3. run this script as sudo if [[ $UID != 0 ]]; then echo "This script neeeds to be run with sudo, like this:" echo -e "\n sudo $0 $*\n" exit 1 fi apt-get install python-software-properties add-apt-repository ppa:webupd8team/java apt-get update apt-get install oracle-java8-installer if [ ! -f $HOME/Downloads/jdk-8u*-linux-*.gz ]; then echo "The JDK tar.gz file was not found in $HOME/Downloads. please download it, put it in $HOME/Downloads and run again." exit 1 fi cp ~/Downloads/jdk-8u*-linux-*.gz /var/cache/oracle-jdk8-installer/ apt-get install oracle-java8-installer apt-get install oracle-java8-set-default java -version