set $JAVA_HOME variable in ubuntu code example Example: set $JAVA_HOME variable in ubuntu export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64