add JAVA_HOME env variable check

add JAVA_HOME env variable check before running path.resolve with process.env.JAVA_HOME