Reputation: 1383
I am learning the basics of maven and am using apache-maven-3.2.2. I have added the M2_HOME and MAVEN_HOME environment variables. However when I run the command mvn -version
it says the maven version is 2.2.1. Following is the result:
Apache Maven 2.2.1 (r801777; 2009-08-07 00:46:01+0530)
Java version: 1.8.0_25
Java home: C:\Program Files\Java\jdk1.8.0_25\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "dos"
Upvotes: 0
Views: 2261
Reputation: 2200
You should have only one global variable for setting maven home directory location. Also update the same variable's bin location (%M2_HOME%\bin
)in System Path variable
Upvotes: 1
Reputation: 375
It looks like your Windows PATH isn't pointing at the correct maven version. From the Maven documentation:
You run Maven by invoking a command-line tool: mvn.bat from the bin directory of the Maven. To do this conveniently, c:\apache-maven-3.0.5\bin must be in your PATH, just like the J2SE SDK commands. You can add directories to your PATH in the control panel; the details vary by Windows version.
You'll need to change that path to point to the 3.2.2 version you have installed.
However, it's also worth noting that the maven command is mvn
, not maven
. I guess that could be a typo on your part, but if not you should make sure you're using the right command (mvn -version
)
Upvotes: 1