Added java auto-detect if JAVA_HOME is not set.