title: xmlbeans-maven-plugin not finding javac
body: <p>I am trying to setup <a href="http://mojo.codehaus.org/xmlbeans-maven-plugin/dependencies.html" rel="nofollow">xmlbeans-maven-plugin 2.3.3</a> in my Eclipse and while everything seems to go OK, It fails with an java.io.IOException due to inability to find the file <code>C:\Users\Daniel\Workspace\MyProject\javac</code>.</p>
  
  <p>This is strange because javac <a href="http://wiki.apache.org/xmlbeans/XmlBeansFaq#scompFindingJavac" rel="nofollow"><em>is</em></a> on the system's %PATH% so why would it try to find it in %PROJECT_LOC%?</p>
  
  <p>I found <a href="http://jira.codehaus.org/browse/MXMLBEANS-65" rel="nofollow">this problem description</a> which sounds very similar to mine, but I placed the JDK path in front of all other paths and that didn't help.</p>
  
  <p>Any idea <strong>how</strong> to tell the <code>xmlbeans-maven-plugin</code> <strong>where</strong> to look for <code>javac</code>?</p>
  
  <p><strong>UPDATE 1:</strong> I tried working around this problem by simply copying <code>javac.exe</code> to the project's directory and at least it now finds it but the problem moved forward to:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
  Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
  Exception in thread "main" Could not find the main class: com.sun.tools.javac.Main.  Program will exit.
  </code></pre>
  
  <p>Any insight that could help come up with the <em>correct</em> solution to this (e.g. something in <a href="http://maven.apache.org/settings.html" rel="nofollow">.m2/settings.xml</a>?) would be appreciated.</p>
  
  <p><strong>UPDATE 2:</strong> I also tried <a href="http://mail-archives.apache.org/mod_mbox/maven-users/201108.mbox/%3CCAA8BW8F28HgpGctSQ_zG5DkKL-xQQmYYm4CS6ZAE=3A9aoN_9g@mail.gmail.com%3E" rel="nofollow">this little solution</a> I found in my searches:</p>
  
  <pre><code>&lt;settings xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                        http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
    &lt;localRepository&gt;c:\maven\repository&lt;/localRepository&gt;
     &lt;configuration&gt;
      &lt;compiler&gt;C:\Program Files (x86)\Java\jdk1.6.0_37\bin\javac.exe&lt;/compiler&gt;
     &lt;/configuration&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>But that didn't help the plugin find <code>javac</code>. It still complains about "The system cannot find the file specified" for javac.exe.</p>