Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.4 when 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.

share|improve this question
    
and how about echo %PATH% –  Anonymous Dec 4 '12 at 7:43
    
it got me the following C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;%PROGRAMFILES%\Internet Explorer;C:\Program Files\TortoiseSVN\bin;%M2 –  Anto Dec 4 '12 at 7:45

1 Answer 1

up vote 3 down vote accepted

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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.