Skip to content

Instantly share code, notes, and snippets.

@zhenkyle
Forked from rtfpessoa/java-8-ami.md
Last active May 6, 2016 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhenkyle/ced9e289bfae1408ffdd0ce7f88edf09 to your computer and use it in GitHub Desktop.
Save zhenkyle/ced9e289bfae1408ffdd0ce7f88edf09 to your computer and use it in GitHub Desktop.
[Guide] Install Sun Java 8 on Amazon EC2 Ami

First verify the version of Java being used is not Sun Java 8 SDK

java -version

Check newest Sun Java 8 SDK version from Oracle

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Get the Sun Java 8 SDK from Oracle

wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm"

Install Sun Java 8

sudo rpm -i jdk-8u92-linux-x64.rpm

Logout & Relogin and check java path

type java

Check if the default java version is set to Sun Java 8 SDK

java -version

If not then lets create one more alternative for Sun Java 8 SDK

sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_92/bin/java 20000

Set the Sun Java 8 SDK 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