title: What is the latest official version of XJC and where can I get it?
body: <p><em>XJC</em> (XML Java Compiler) is part of <em>JAXB</em> (Java XML Bindings).</p>
  
  <p>If I look at the <a href="https://jaxb.java.net" rel="noreferrer">official website</a>, the latest version of <em>JAXB</em> seems to be <strong>2.2.11</strong>. That's the one you got when you just install the latest JDK version <strong>8u40</strong>.</p>
  
  <p>The following output shows the version of <em>XJC</em> related to JDK 8u40: </p>
  
  <pre><code>../JDK8u40/bin$ ./javac -version
  javac 1.8.0_40
  ../JDK8u40/bin$ ./xjc -version
  xjc 2.2.8-b130911.1802
  </code></pre>
  
  <p>(The original JDK path differs from OS to OS, so this is just an exemplary representation.)</p>
  
  <p>It seems the version of <em>XJC</em> differs to the "latest" <em>JAXB</em> version or the latest JDK does not contain the latest JAXB version.</p>
  
  <p>My workaround is to just install the latest JAXB version from the <a href="http://mvnrepository.com/artifact/javax.xml.bind/jaxb-api" rel="noreferrer">Maven repository</a>. Sounds easy, but why the latest version of JAXB is <strong>2.2.12</strong> now? Forgot to put the documentation on the offical website? Okay, I just try to don't care... After the successful installation process I noticed there is no <em>XJC</em> inside this package. So go on searching... I found another Maven repository with the name "<a href="http://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-xjc" rel="noreferrer">JAXB-XJC</a>". But this is just the source code. I simply want to install the latest binary of <em>XJC</em>. I looked at the version number, which is <strong>2.2.11</strong>. That looks at least better than 2.2.8.</p>
  
  <p><strong>But where I can get the latest binary of <em>XJC</em>?</strong></p>
  
  <p>Why I want to install the latest binary of <em>XJC</em>? Because I want to know if it supports Optionals of Java 8 and/or if it supports XSD schema version 1.1. Somewhere on the Internet I read the latest <em>XJC</em> at least supports the XSD schema version 1.1. That would be enough for now. But to figure this out, it seems Oracle has to fix their horrible version chaos.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I tried to build JAXB by cloning the official <a href="https://github.com/gf-metro/jaxb" rel="noreferrer">Git repository</a> and doing <code>mvn clean install</code>.</p>
  
  <p>Result:</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO] 
  [INFO] JAXB BOM ........................................... SUCCESS [  0.140 s]
  [INFO] JAXB BOM with ALL dependencies ..................... SUCCESS [  0.005 s]
  [INFO] JAXB Reference Implementation ...................... SUCCESS [  0.515 s]
  [INFO] JAXB External parent ............................... SUCCESS [  0.009 s]
  [INFO] RNGOM .............................................. SUCCESS [  3.723 s]
  [INFO] Codemodel .......................................... SUCCESS [  0.008 s]
  [INFO] Codemodel Core ..................................... SUCCESS [  2.622 s]
  [INFO] Codemodel Annotation Compiler ...................... SUCCESS [  0.848 s]
  [INFO] JAXB TXW parent .................................... SUCCESS [  0.006 s]
  [INFO] TXW2 Runtime ....................................... SUCCESS [  1.920 s]
  [INFO] TXW2 Compiler ...................................... SUCCESS [  1.507 s]
  [INFO] JAXB Core .......................................... SUCCESS [  1.745 s]
  [INFO] JAXB Runtime parent ................................ SUCCESS [  0.008 s]
  [INFO] JAXB Runtime ....................................... SUCCESS [  5.932 s]
  [INFO] JAXB1 Runtime ...................................... SUCCESS [  1.520 s]
  [INFO] JAXB XJC ........................................... SUCCESS [  5.555 s]
  [INFO] JAXB JXC ........................................... SUCCESS [  2.928 s]
  [INFO] Parent for osgi testing modules. ................... SUCCESS [  0.009 s]
  [INFO] osgi-test-parent ................................... SUCCESS [  1.315 s]
  [INFO] osgi-test-core ..................................... SUCCESS [  0.676 s]
  [INFO] JAXB bundles ....................................... SUCCESS [  0.007 s]
  [INFO] Old JAXB Core ...................................... SUCCESS [  4.669 s]
  [INFO] osgi-test-runtime .................................. SUCCESS [  0.677 s]
  [INFO] Old JAXB Runtime ................................... SUCCESS [  3.251 s]
  [INFO] osgi-test-xjc ...................................... SUCCESS [  0.637 s]
  [INFO] Old JAXB XJC ....................................... SUCCESS [  4.385 s]
  [INFO] osgi-test-jxc ...................................... SUCCESS [  0.607 s]
  [INFO] Old JAXB JXC ....................................... SUCCESS [  2.169 s]
  [INFO] JAXB Documentation parent .......................... SUCCESS [  0.005 s]
  [INFO] JAXB Release Documentation ......................... SUCCESS [ 12.401 s]
  [INFO] JAXB samples ....................................... SUCCESS [  0.375 s]
  [INFO] JAXB RI ............................................ SUCCESS [  1.079 s]
  [INFO] JAXB OSGI parent ................................... SUCCESS [  0.005 s]
  [INFO] JAXB extra OSGI .................................... FAILURE [  6.668 s]
  [INFO] JAXB OSGI .......................................... SKIPPED
  [INFO] osgi-test-osgi ..................................... SKIPPED
  [INFO] osgi-test-extra_osgi ............................... SKIPPED
  [INFO] JAXB OSGi Tests .................................... SKIPPED
  [INFO] JAXB WWW Help files ................................ SKIPPED
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 01:08 min
  [INFO] Finished at: 2015-03-11T15:40:59+01:00
  [INFO] Final Memory: 83M/1546M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (default) on project jaxb-extra-osgi: Error creating shaded jar: java.util.jar.Attributes cannot be cast to java.lang.String -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  [ERROR] 
  [ERROR] After correcting the problems, you can resume the build with the command
  [ERROR]   mvn &lt;goals&gt; -rf :jaxb-extra-osgi
  </code></pre>
  
  <p>The build process always fails at the <em>JAXB extra OSGI</em> target. The <em>JAXB XJC</em> target builds successfully, but only contains a exceptions throwing jar file but no binary named <em>xjc</em>. So where is it?</p>