Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miroslavtamas/70c2760cc13013706f50e5ff376ef701 to your computer and use it in GitHub Desktop.
Save miroslavtamas/70c2760cc13013706f50e5ff376ef701 to your computer and use it in GitHub Desktop.
Install Oracle JDK 8u72 Linux x64 from command line on CentOS
#!/bin/sh
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.tar.gz"
tar xzf jdk-8u72-linux-x64.tar.gz
mkdir /usr/java
mv jdk1.8.0_72/ /usr/java/
alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_72/bin/java 1
alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_72/bin/javac 1
alternatives --config java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment