title: Java's default JAXB implementation is chosen over my classpath
body: <p>I've written a java application that utilizes JAXB for XSL transforms.  I've included the saxon9.jar in my classpath so that I can use XSLT 2.0 rather than XSLT 1.0 on the command line.</p>
  
  <pre><code>java -classpath ./lib/saxon9.jar:./ -jar myApp.jar
  </code></pre>
  
  <p>I've included code in my XSL to report the XSLT used.</p>
  
  <pre><code>&lt;xsl:comment&gt;&lt;xsl:text &gt;
  &lt;/xsl:text&gt;XSLT Version: &lt;xsl:value-of select="system-property('xsl:version')" /&gt; &lt;xsl:text &gt;
  &lt;/xsl:text&gt;XSLT Vendor: &lt;xsl:value-of select="system-property('xsl:vendor')" /&gt; &lt;xsl:text &gt;
  &lt;/xsl:text&gt;XSLT Vendor URL: &lt;xsl:value-of select="system-property('xsl:vendor-url')" /&gt; &lt;xsl:text &gt;
  &lt;/xsl:text&gt;&lt;/xsl:comment&gt;
  </code></pre>
  
  <p>It reports.</p>
  
  <pre><code>XSLT Version: 1.0
  XSLT Vendor: Apache Software Foundation (Xalan XSLTC)
  XSLT Vendor URL: http://xml.apache.org/xalan-j
  </code></pre>
  
  <p>This is the default implementation that is part of the JVM.</p>
  
  <p><strong>How do I get it to use the Saxon that I specified?</strong></p>
  
  <hr>
  
  <p><strong>Follow up:</strong></p>
  
  <p>So none of these methods worked (except placing the saxon jar in the endorsed directory), but they all should have worked.  It seems the combination of my using the "-jar myApp.jar" and wanting an alternative XSLT implementation were incompatible.  In other words...</p>
  
  <p>java -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl -classpath ./lib/saxon9.jar:./ -jar myApp.jar</p>
  
  <p>...does not work, but this does...</p>
  
  <p>java -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl -classpath ./lib/saxon9.jar:./myApp.jar org.dacracot.myApp</p>
  
  <p>...interestingly, I don't even have to specify the factory and I get the saxon version...</p>
  
  <p>java -classpath ./lib/saxon9.jar:./myApp.jar org.dacracot.myApp</p>