Skip to content

Instantly share code, notes, and snippets.

@vallettea
Created November 5, 2013 00:13
Show Gist options
  • Select an option

  • Save vallettea/7311715 to your computer and use it in GitHub Desktop.

Select an option

Save vallettea/7311715 to your computer and use it in GitHub Desktop.
install jdk 7 from oracle/sun on amazon ec2
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-x64.rpm"
# Install Java
sudo rpm -i jdk-7u21-linux-x64.rpm
# Check if the default java version is set to sun jdk
java -version
# If not then lets create one more alternative for Java for Sun JDK
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_21/bin/java 20000
# Set the SUN JDK as the default java
sudo /usr/sbin/alternatives --config java
# Verify if change in SDK was done.
java -version
#otherwise add /usr/java/jdk1.7.0_21/bin to path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment