more smart JAVA_HOME detection