Skip to content

Instantly share code, notes, and snippets.

@stuartf7
Last active December 12, 2015 12:38
Show Gist options
  • Save stuartf7/4772864 to your computer and use it in GitHub Desktop.
Save stuartf7/4772864 to your computer and use it in GitHub Desktop.
Installing Oracle JSDK 1.6 (32bit) on Amazon Linux
# Download Java (Note the required cookie to accept Oracle's license)
wget -O jdk-6u39-linux-i586-rpm.bin --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-6u39-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/6u39-b04/jdk-6u39-linux-i586-rpm.bin
# Install Oracle Java
chmod +x jdk-6u39-linux-i586-rpm.bin
sudo sh jdk-6u39-linux-i586-rpm.bin
# Create an alternative for Java for Oracle JDK
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_39/bin/java 20000
sudo /usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_39/bin/javac 20000
# Verify if the Oracle Java is installed.
java -version
# Clean up the installation files
rm -rf jdk-*
rm -rf sun-*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment