I downloaded and unzipped the Maven directory on my C: drive.
Set M2_HOME : C:\opt\apache-maven-3.6.3 in the environment variable.
I have added %M2_HOME%\bin to the path.
But when I try to run mvn -version, it says "mvn" is not recognized.
But when I run %M2_HOME%\bin\mvn -version it works fine.
M2_HOME
. Try adding the full path instead or make sureM2_HOME
is defined beforePATH
. – kriegaexM2_HOME
only add the location of the bin directory into thePATH
variable. After you have changed the environment close the all consoles and reopen the console. – khmarbaise