1

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?

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
eskalera
  • 1,072
  • 2
  • 21
  • 36

3 Answers3

6

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

basiljames
  • 4,777
  • 4
  • 24
  • 41
  • thx basiljames and @kothvandir, i've done so. I get the right structure now, but still getting the same error: M2_HOME is set to an invalid directory, no matter what directory a invoke mvn -version from. I've tried moving straight into to C:\maven and all the above too! – eskalera Sep 20 '12 at 08:37
  • Problem solved. I only had to delete the User Variable that I had created following the maven installation instructions. Afeter downloading and installing the binary zip and deleting that variable everything worked like a charm. Thanks! – eskalera Sep 20 '12 at 09:51
1

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.

kothvandir
  • 2,111
  • 2
  • 19
  • 34
0

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.

Kambiz
  • 11
  • 2