improve JDK_HOME and JRE_HOME detection