0
votes

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.

1
Probably your path is defined before M2_HOME. Try adding the full path instead or make sure M2_HOME is defined before PATH.kriegaex
Remove M2_HOME only add the location of the bin directory into the PATH variable. After you have changed the environment close the all consoles and reopen the console.khmarbaise
@kriegaex it worked. I added the full path and it worked. Thank you.Nick Sharma
@khmarbaise Thank you. After adding the full path it worked.Nick Sharma

1 Answers

0
votes

try to reload your console / command line window - IFAIK the %PATH% variable is read only once - when the console window is opened