fixes and support for JAVA_HOME