Make script respect JAVA_HOME variable.