Skip to content

Instantly share code, notes, and snippets.

@fdimuccio
Created September 23, 2014 13:33
Show Gist options
  • Select an option

  • Save fdimuccio/5f163b25d2ac6832e68d to your computer and use it in GitHub Desktop.

Select an option

Save fdimuccio/5f163b25d2ac6832e68d to your computer and use it in GitHub Desktop.
Oracle JDK Amazon EC2 installer
#!/usr/bin/env bash
ORACLE_JDK='http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-linux-x64.rpm'
JDK_FILENAME=/home/ec2-user/jdk-linux-x64.rpm
#if [ ! -f $JDK_FILENAME ]
#then
wget -O $JDK_FILENAME --no-check-certificate --no-cookies - --header "Cookie: oraclelicense=accept-securebackup-cookie" $ORACLE_JDK
rpm -Uvh $JDK_FILENAME
alternatives --install /usr/bin/java java /usr/java/default/bin/java 3
alternatives --set java /usr/java/default/bin/java
#fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment