title: Using JAX-WS 2.2.5 client with JDK/JRE 1.5
body: <p>Java 6 shipped with JAX-WS 2.0. Java 5 didn't ship with JAX-WS as far as I know.</p>
  
  <p>I was able to use JAX-WS 2.2.5 with Java 1.6 for creating Webservice client stubs by using the <a href="https://docs.oracle.com/javase/6/docs/technotes/guides/standards/" rel="nofollow noreferrer">Java Endorsed Override Mechansim</a> which lists JAX-WS as one of the components which can be replaced in Java 6.</p>
  
  <p>All I had to do was create a lib\endorsed directory in my JDK &amp; JRE 6 paths &amp; then copy jaxb-api.jar &amp; jaxws-api.jar from JAX-WS 2.2.5 into the directory named endorsed. And both JDK &amp; JRE 6 picked up the 2.2.5 JAX-WS automatically. </p>
  
  <p>I could not find similar Java Endorsed Override Mechanism in the Java 5 documents. How I found one <a href="http://www.cs.mun.ca/java-api-1.5/guide/standards/index.html" rel="nofollow noreferrer">here</a>. This doesn't explicty mention JAX-WS like the Java 6 documents, but it also mentions the endorsed dirs.</p>
  
  <p>I created a similar 'endorsed' directory in both the JDK &amp; JRE lib directory. I copied all the jars from JAX-WS 2.2.5 (a total of 23 jars) into the endorsed directory. However, unlike Java 6, neither javac.exe nor java.exe picked this up directly. I had to run both java.exe and javac.exe with this command line argument </p>
  
  <pre><code>-Djava.endorsed.dirs=&lt;JDK/JRE1.5_DIR&gt;\lib\endorsed
  </code></pre>
  
  <p>Everything seems to work fine, but I am wondering if this is guaranteed to work - any problems anyone has faced before? Does JAX-WS 2.2.5 support Java 5?</p>