title: How to run code that uses JAXB under Java 1.9 when deployed via Java Web Start
body: <p>I have three applications I deploy with Java Web Start to clients. All three of these applications use JAXB. Under Java 1.9 to get the jaxb module loaded you have to use:</p>
  
  <pre><code>--add-modules java.xml.bind
  </code></pre>
  
  <p>Java Web Start let's you pass VM arguments to applications with the java-vm-args attribute of the java/j2se tag. However, only the arguments listed in the documentation are supported and <code>--add-modules</code> is not in <a href="https://docs.oracle.com/javase/9/deploy/jnlp-file-syntax.htm#JSDPG-GUID-F32AB01F-C9AF-4D7B-B9CB-66ACE2771846" rel="nofollow noreferrer">that list</a>.</p>
  
  <p>So the question is how do you pass <code>"--add-modules java.xml.bind"</code> to the 1.9 VM when running code via Java Web Start that uses JAXB?</p>
  
  <p>Here is what I tried and my testing shows that --add-modules is indeed not supported by the java-vm-arg attribute:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;property name="jnlp.packEnabled" value="true"/&gt;
      &lt;java version="9" java-vm-args="--add-modules java.xml.bind"/&gt;
      &lt;java version="1.8+"/&gt;
      &lt;jar href="redacted.jar"/&gt;
  &lt;/resources&gt;
  </code></pre>