troubleshooting Question

Installation of Maven

Avatar of sylph
sylph asked on
JavaJava EE
4 Comments1 Solution490 ViewsLast Modified:

I downloaded maven apache from , and followed the installation guide at for Windows XP (I'm using windows 7 actually).

I unzip the downloaded archive, put it in C:\Program Files\Apache Software Foundation
Thus the path will be C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\

I set my environment variable as follow :-
M2_HOME   -> C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\bin
PATH -> %M2_HOME%;  //added this at the end of the line

I have my JDK installed at
PATH -> C:\Program Files\Java\jdk1.6.0_17\bin  //added this at the beginning of the line
JAVA_HOME -> C:\Program Files\Java\jdk1.6.0_17

I have these :
M2 ->  %M2_HOME%

Then I went to cmd line , cd to C:\Program Files\Java\jdk1.6.0_17\bin and type "mvn install" , and enter

I get this error :
M2_HOME is set to invalid directory
M2_HOME = "C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\bin"
Please set the M2_HOME variable in your environment to match the location of Maven installation.

Can anyone point out which part I have done wrong? I tried to change the path to different path, like without the "bin" ,then reboot, but I still get the same error.

Thanks !


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros