Apache Maven install "'mvn' not recognized as an internal or external command" after setting OS environmental variables?

mre picture mre · Aug 9, 2012 · Viewed 115.7k times · Source

I've followed the official installation instructions here for Windows XP. But sometimes when I execute mvn --version, I receive the error message,

'mvn' not recognized as an internal or external command

I've even rebooted my machine a couple times, but the OS does not always recognize the maven command. But when I execute either, cd %M2_HOME%, or cd %M2% it brings me to the installation directory. I've also made sure to add the user variable M2 to the Path system variable.

So, what gives?

Answer

Pshemo picture Pshemo · Aug 9, 2012

Way around would be moving M2 from user variables to system variables