Cogs and Levers A blog full of technical stuff

Upgrading AWS Linux to use Java 8

Some applications that you’ll come across will require Java 8 in order to run. By default (as of the time of this article), the Amazon Linux AMI has Java 7 installed.

In order to upgrade these machines so that they are using Java 8, use the following:

# make sure that you install java8 prior to removing java7
sudo yum install -y java-1.8.0-openjdk.x86_64

# update the binary links in-place
sudo /usr/sbin/alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
sudo /usr/sbin/alternatives --set javac /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/javac

# remove java7
sudo yum remove java-1.7

That’s it. You’re now running Java 8.