Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .