improve detection JRE/JDK home detection using which and default JRE location when JDK is installed

fix for #1