0

I installed maven as per http://maven.apache.org/download.cgi and I created the following environment variables:

JAVA_HOME : C:\Program Files (x86)\Java\jre7
M2 : %M2_HOME%\bin
M2_HOME : C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.1.0

And, I prepended PATH with this:

%M2%;%JAVA_HOME%\bin;

When I try to run cmd and enter mvn --version it says:

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

user1477388
  • 20,790
  • 32
  • 144
  • 264
  • 1
    I ran into this not long ago... Path doesn't support multiple levels of nesting, it'll only evaluate the first layer. Try setting `M2` to the same value as `M2_HOME` and adding `\bin` to the end – StormeHawke Sep 23 '13 at 19:30
  • 1
    Thanks, that seems to work. It should also be noted that these should be added under "System variables" and not "User variables." – user1477388 Sep 23 '13 at 19:32

1 Answers1

1

I ran into this not long ago... PATH doesn't support multiple levels of nesting, it'll only evaluate the first layer. Try setting M2 to the same value as M2_HOME and adding \bin to the end

StormeHawke
  • 5,987
  • 5
  • 45
  • 73