Skip to content

Instantly share code, notes, and snippets.

@masbog
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save masbog/8839696 to your computer and use it in GitHub Desktop.

Select an option

Save masbog/8839696 to your computer and use it in GitHub Desktop.
Change OpenJDK to OracleJDK 8 (CentOS 6)
yum -y remove java-1.6.0-openjdk
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.rpm" \
-O /opt/jdk-8-linux-x64.rpm
rpm -Uvh /opt/jdk-8-linux-x64.rpm
alternatives --install /usr/bin/java java /usr/java/jdk1.8.0/jre/bin/java 20000
alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0/bin/jar 20000
alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0/bin/javac 20000
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.8.0/jre/bin/javaws 20000
alternatives --set java /usr/java/jdk1.8.0/jre/bin/java
alternatives --set javaws /usr/java/jdk1.8.0/jre/bin/javaws
alternatives --set javac /usr/java/jdk1.8.0/bin/javac
alternatives --set jar /usr/java/jdk1.8.0/bin/jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment