title: Unable to install Maven on Windows: "JAVA_HOME is set to an invalid directory"
body: <p>I followed <a href="http://maven.apache.org/download.html#Installation" rel="noreferrer">the Maven tutorial</a> to the letter but I still can't get Maven installed on Windows.</p>
  
  <p>When I run the following in command prompt:</p>
  
  <pre><code>E:\Documents and Settings\zach&gt;mvn --version
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>'mvn' is not recognized as an internal or external command, operable program or batch file.
  </code></pre>
  
  <p>I navigated to the maven install folder and ran <code>mvn --version</code> and got:</p>
  
  <pre><code>E:\java resources\apache-maven-2.2.0\bin&gt;mvn --version
  ERROR: JAVA_HOME is set to an invalid directory.
  JAVA_HOME = "E:\Sun\SDK\jdk\bin"
  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation
  </code></pre>
  
  <p>but when I run <code>java -version</code> I get:</p>
  
  <pre><code>java version "1.6.0_14"
  Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
  Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)
  </code></pre>
  
  <p>So I do have Java installed. Anyone know what the problem is?</p>