Skip to content

Instantly share code, notes, and snippets.

@TamerShlash
Last active August 27, 2016 12:05
Show Gist options
  • Save TamerShlash/f9519fd570a9b0d76165 to your computer and use it in GitHub Desktop.
Save TamerShlash/f9519fd570a9b0d76165 to your computer and use it in GitHub Desktop.
Install Oracle Java 8 on Ubuntu from Syria (or if Oracle blocks you)
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment