Question

I've just downloaded Maven 3.0.4.

My variables are:

M2_HOME C:\Program Files (x86)\apache-maven-3.0.4
JAVA_HOME C:\Program Files\Java\jdk1.6.0_35

and my PATH

C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;%FRASCATI_HOME%/bin;%JAVA_HOME%\bin;%M2_HOME%\bin

I get this error when not on maven directory:

C:\Users\rmescalera>mvn -version
"mvn" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

and this other from maven directory:

ERROR: M2_HOME is set to an invalid directory. M2_HOME = "C:\Program Files (x86)\apache-maven-3.0.4\bin" Please set the M2_HOME variable in your environment to match the location of the Maven installation

The point is in the maven webpage it says to set %MAVEN_HOME%\bin in the PATH but when I download and extract the zip, this is the structure I get:

maven directories

So, obviously there is no bin directory in apache-maven-3.0.4!

I have tried copying only what's inside
C:\Program Files (x86)\apache-maven-3.0.4\apache-maven\src into a new C:/maven directory and setting the right variables

What's wrong? And what's up with this directory structure I get? Where should my variables point at?

Was it helpful?

Solution

Seems you have dowloaded the maven source code. Download from here. Make sure you are downloading (Binary zip)

OTHER TIPS

You've downloaded the source tar/zip of maven, if you want to use that release you have to compile it before. Download the binary distribution instead.

I had the same problem installing maven 3.1.1. The reason was that i had also an older version of maven 2.0.4 in the path variable, before my %M2_HOME%\bin

I removed the older one from the PATH and it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top