Skip to content

Instantly share code, notes, and snippets.

@shyam
Forked from lelayf/gist:1929949
Created February 29, 2012 13:30
Show Gist options
  • Save shyam/1940844 to your computer and use it in GitHub Desktop.
Save shyam/1940844 to your computer and use it in GitHub Desktop.
Procedure for installing and setting Sun JDK Java 6 on Amazon Linux AMI 64bit
# Get latest Sun Java SDK in v6 from Oracle
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64-rpm.bin
# make it exec
chmod +x jdk-6u31-linux-x64-rpm.bin
# Install Java
sudo ./jdk-6u31-linux-x64-rpm.bin
# Check if the default java version is set to sun jdk
# Normally it says OpenJDK
java -version
# Lets create one more alternative for Java for Sun JDK
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_31/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment