Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Oracle JDK on Ubuntu
#!/bin/bash
JDK_UPDATE_VERSION=144
JDK_BUILD_VERSION=b01
JDK_HASH=090f390dda5b47b9b721c7dfaa008135
echo "installing Oracle jdk1.8.0_${JDK_UPDATE_VERSION}..."
wget -N --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u$JDK_UPDATE_VERSION-$JDK_BUILD_VERSION/$JDK_HASH/jdk-8u$JDK_UPDATE_VERSION-linux-x64.tar.gz
sudo mkdir -p /opt/jdk
sudo tar -zxf jdk-8u${JDK_UPDATE_VERSION}-linux-x64.tar.gz -C /opt/jdk
sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_${JDK_UPDATE_VERSION}/bin/java 100
rm jdk-8u${JDK_UPDATE_VERSION}-linux-x64.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.