Search code examples
windowsmaven

Maven: mvn command not found


I set the following system veriables (OS = Vista):

M2_HOME = C:\Program Files\Maven 
M2 = %M2_HOME%\bin 
path = %M2% 

If i run mvn -- version I get:

mvn: command not found

Anyone have any idea why this could be? Thanks.


Solution

  • If you are on windows, what i suppose you need to do set the PATH like this:

    SET PATH=%M2%
    

    furthermore i assume you need to set your path to something like C:...\apache-maven-3.0.3\ cause this is the default folder for the windows archive. On the other i assume you need to add the path of maven to your and not set it to only maven so you setting should look like this:

    SET PATH=%PATH%;%M2%