detect JRE (vs JDK) and invalid JAVA_HOME

fixes #3739