Updated to always use JRE in JAVA_HOME if set.