Skip to content

Instantly share code, notes, and snippets.

@pchan37
Last active January 24, 2018 01:52
Show Gist options
  • Save pchan37/09f1d0ee2f0a299c1a2355cac344623c to your computer and use it in GitHub Desktop.
Save pchan37/09f1d0ee2f0a299c1a2355cac344623c to your computer and use it in GitHub Desktop.
Manually install Java JDK 1.8 update 162 (cuz you don't want to screw yourself over)
#!/usr/bin/env bash
echo 'Removing old version of openjdk'
sudo apt remove openjdk-8-jdk openjdk-8-jre -y
sudo apt autoremove -y
echo 'Download jdk 1.8.0 update 162'
wget --quiet -c --header "Cookie: oraclelicense=accept" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz
echo 'Installing jdk 1.8.0 update 162'
tar -zxf jdk-8u162-linux-x64.tar.gz
sudo mv jdk1.8.0_162 /opt/
sudo ln -sf /opt/jdk1.8.0_162/bin/java /usr/bin/java
sudo ln -sf /opt/jdk1.8.0_162/bin/javac /usr/bin/javac
sudo ln -sf /opt/jdk1.8.0_162/bin/javadoc /usr/bin/javadoc
echo 'Success!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment