1. Find where Java lives:

which java

2. Set JAVA_HOME:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/

3. Set the Java path:

export PATH=$PATH:$JAVA_HOME

4. Confirm path is set (as above) correctly:

echo $JAVA_HOME

Written by Matt Cooper
Hi, I'm Matt Cooper. I started this blog to pretty much act as a brain dump area for things I learn from day to day. You can contact me at: matt@linuxtutorial.co.uk.