Added check for the existence of JAVA_HOME.