Checking JAVA_HOME in a better way
Fixed the if with JAVA_HOME, before it wasn't working