Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: mvn command not found

Tags:

windows

maven

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.

like image 201
Roaz Avatar asked May 18 '12 09:05

Roaz


2 Answers

Maven setup:

a. install maven from https://maven.apache.org/download.cgi

b. unzip maven and keep in C drive.

c. Set MAVEN_HOME in system variable. enter image description here

d. Set path for maven enter image description here

like image 156
Abdur Rahman Avatar answered Sep 22 '22 07:09

Abdur Rahman


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% 
like image 20
khmarbaise Avatar answered Sep 24 '22 07:09

khmarbaise