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?
mvn -version 'mvn' is not recognized as an internal or external command, operable program or batch file. Answer: Refer to Step 4, make sure the %MAVEN_HOME%\bin is added to the PATH system variable. Answer: Refer to Step 2, make sure JDK is installed and the JAVA_HOME system variable is configured.
The mvn executable has to be added to your PATH variable. Alternatively you can try starting mvn from its bin-directory as a first test.
Way around would be moving M2
from user variables to system variables
Looks like maven is not present in your PATH. Add the absolute maven home\bin location to your PATH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With