Better error handling for MAVEN_HOME and JAVA_HOME

— but those methods really shouldn’t be here…