title: Installing Maven
body: <p>I am having trouble getting Maven 3.0.3 to install properly. I have read over <a href="https://stackoverflow.com/questions/1184056/unable-to-install-maven">Unable to install Maven on Windows: &quot;JAVA_HOME is set to an invalid directory&quot;</a> but none of the answers were able to solve my problem.</p>
  
  <p>This is what I did:</p>
  
  <ul>
  <li>Went to <a href="http://maven.apache.org/download.html" rel="nofollow noreferrer">http://maven.apache.org/download.html</a> and downloaded apache-maven-3.0.3-bin.zip</li>
  <li>Extracted files to C:\Program Files, so I now have a directory called apache-maven-3.0.3</li>
  <li>Went to my system's environment variables and created user variable <code>M2_HOME</code>, value is <code>C:\Program Files\apache-maven-3.0.3\bin</code></li>
  <li><code>JAVA_HOME</code> variable is set properly, can get version from cmd line</li>
  <li>Edited <code>PATH</code> so the value is now <code>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseHg\;%JAVA_HOME%;%M2_HOME%</code></li>
  </ul>
  
  <p>When I go to cmd, I this is what I get:</p>
  
  <pre><code>   D:\&gt;java -version
      java version "1.6.0_25"
      Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
      Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
  
      D:\&gt;mvn --version
      'mvn' is not recognized as an internal or external command,
      operable program or batch file.
  </code></pre>
  
  <p>However, if I am actually in the directory I can do the following:</p>
  
  <pre><code>D:\&gt;cd C:\Program Files\apache-maven-3.0.3\bin
  
  D:\&gt;C:
  
  C:\Program Files\apache-maven-3.0.3\bin&gt;mvn --version
  Apache Maven 3.0.3 (r1075438; 2011-02-28 11:31:09-0600)
  Maven home: C:\Program Files\apache-maven-3.0.3
  Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
  Java home: C:\Program Files\Java\jdk1.6.0_25\jre
  Default locale: en_US, platform encoding: Cp1252
  OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
  </code></pre>
  
  <p>Is this how it should actually work? From what I have been told I should not have to be in the directory like that to use any mvn commands. Thank you for your time!</p>