Skip to content

Instantly share code, notes, and snippets.

@angeloh
Last active May 1, 2018 05:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angeloh/46e08907cf3a2969e2ed24390a727841 to your computer and use it in GitHub Desktop.
Save angeloh/46e08907cf3a2969e2ed24390a727841 to your computer and use it in GitHub Desktop.
Procedure for installing and setting Sun JDK Java 8 on Default Amazon Linux AMI
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.rpm
# Install Java
sudo rpm -i jdk-8u172-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.8.0_172-amd64/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