'mvn' is not recognized as an internal or external command

I get the following error when i type the command mvn --version

'mvn' is not recognized as an internal or external command, operable program or batch file.

I have also followed this but still i am unable to get the work done.

when i type this command echo %M2_HOME% i get path printed as D:\Program Files\apache-maven-3.0.4when i type 'echo %M2%' i get the path printed as D:\Program Files\apache-maven-3.0.4\bin

Environment : Windows XP

Please help me to resolve this.

2

1 Answer

You need to append maven bin directory path to Windows %PATH% variable.

Control Panel -> System -> Advanced system settings -> Advanced Tab -> Environment Variables -> The path variable is in the second section the *System variables*.

Ensure you have the value ;%M2_HOME%\bin; (note the semi-colon, different paths should be separated by them) in order for Windows to be able to find the Maven command definitions.

Ensure you restart your command prompt. Environment variables need to be set before you open your command prompt.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like