I'm setting up Maven on Windows and I think everything is set up correctly, but I'm still getting the error "The JAVA_HOME environment variable is not defined correctly" when I run
mvn --version
In my environment variables, I have the following:
User variables
System Variables
Inside System Variables, in my Path variable, I have:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\ProgramData\Oracle\Java\javapath
C:\Program Files\Java\jdk-11.0.2\bin
C:\apache-maven-3.6.3\bin
Can't seem to figure out what's wrong with these environment variables such that Maven would be giving me that error. Any help would be greatly appreciated!
Your JAVA_HOME is incorrect. JAVA_HOME should be "C:\Program Files\Java\jdk-11.0.2"
Remember to reopen new console after reset JAVA_HOME environment to apply new value.