add JAVA_HOME env varible check before running path.resolve with process.env.JAVA_HOME and return a more meaningful error message.