added check for setting JAVA_HOME