title: Maven build failed: "Unable to locate the Javac Compiler in: jre or jdk issue"
body: <p>I have my JAVA_HOME set to:</p>
  
  <pre class="lang-none prettyprint-override"><code>C:\Program Files (x86)\Java\jdk1.6.0_18
  </code></pre>
  
  <p>After I run <code>maven install</code>, I get this message from <a href="https://en.wikipedia.org/wiki/Eclipse_%28software%29" rel="nofollow noreferrer">Eclipse</a>:</p>
  
  <p>Reason:</p>
  
  <pre class="lang-none prettyprint-override"><code>Unable to locate the Javac Compiler in:
    C:\Program Files (x86)\Java\jre6\..\lib\tools.jar
  Please ensure you are using JDK 1.4 or above and
  not a JRE (the com.sun.tools.javac.Main class is required).
  In most cases you can change the location of your Java
  installation by setting the JAVA_HOME environment variable.
  </code></pre>
  
  <p>I'm certain that this is the tricky part</p>
  
  <blockquote>
    <p>Please ensure you are using JDK 1.4 or
    above and
        not a JRE</p>
  </blockquote>
  
  <p>When I run configuration it's set to JRE6. How do I change it to JDK 1.6 which I have already installed?</p>
  
  <p>I even tried to modify the plugin:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.0.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;source&gt;1.6&lt;/source&gt;
          &lt;target&gt;1.6&lt;/target&gt;
          &lt;executable&gt;C:\Program Files (x86)\Java\jdk1.6.0_18\bin&lt;/executable&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Still I get the same error.</p>
  
  <p>I use the Eclipse Maven plugin. How can I change from JRE to JDK in Eclipse?</p>