Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Can <code>xjc -version</code> be trusted?</strong></p> <p>YES. It will give you the version of the XJC tool.</p> <hr> <p><strong>Can <code>xjc -version</code> be trusted to give the version of the <a href="http://jcp.org/en/jsr/detail?id=222" rel="nofollow">JAXB (JSR-222)</a> Runtime Implementation?</strong></p> <p>NO:</p> <ul> <li>There is no requirement that the version of the XJC tool match the version of the JAXB runtime implementation. </li> <li>There is also no requirement that the XJC tool and the JAXB runtime implementation come from the same implementation of JAXB. For example the XJC tool could come from <a href="http://jaxb.java.net/" rel="nofollow"><strong>Project JAXB</strong></a> and the runtime could be <a href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow"><strong>EclipseLink JAXB (MOXy)</strong></a>.</li> </ul> <hr> <p><strong>JAXB RI and the JAXB Impl Included in the JDK/JRE</strong></p> <p>Java SE implementations (version 6 and above) are required to include a version of JAXB (JSR-222). What is often (but not required to be) included is a <strong>package renamed</strong> version of the JAXB RI. So if you run the following:</p> <pre><code>import javax.xml.bind.JAXBContext; public class Demo { public static void main(String[] args) throws Exception { JAXBContext jc = JAXBContext.newInstance(Demo.class); System.out.println(jc.getClass()); } } </code></pre> <p>You get:</p> <pre><code>class com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl </code></pre> <p>If you download a version of the <a href="http://jaxb.java.net/" rel="nofollow"><strong>JAXB-RI</strong></a> and add it to your class path and re-run the same demo code the output will change to the following:</p> <pre><code>class com.sun.xml.bind.v2.runtime.JAXBContextImpl </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload