Choose java executable based on $JAVA_HOME setting in scripts