Search code examples
javajakarta-ee

Which criterias to consider when replacing the Java EE modules removed from JDK?


In JDK 11, Oracle has removed the following modules from the JDK:

 java.xml.ws
 java.xml.bind
 java.xml.ws.annotation
 

The following are possible replacement for the removed modules:

jakarta
com.sun.xml // The reference Implementation

In the following link http://openjdk.java.net/jeps/320, it is recommended to replace the modules with the reference implementation from sun.

What are the criterias to choose the appropriate replacement?


Solution

  • It's not really "choose between Jakarta or the Sun reference implementation". Jakarta is now what used to be called Java EE (Oracle handed it over to the Eclipse Foundation and it got a new name). The standards are developed under the Jakarta project, and for each standard (such as JAX-WS) there is a reference implementation.

    Other vendors might implement the standard independently. The choice is not between "Jakarta or the Sun reference implementation", but between the reference implementation and an implementation by another vendor.

    For example, look at JAXB (the Java API for XML Binding). There is a reference implementation and there is also MOXy, which is a separate implementation that has some extra, non-standard features.

    Here is the Jakarta page about JAX-WS, which lists two implementations: the reference implementation which has Maven coordinates jakarta.xml.ws:jakarta.xml.ws-api:jar:2.3.3, and Eclipse Metro which is an alternative implementation.

    To choose, you need to look at the features of both and decide what you want to use.

    Note that if you are running your software on a Java EE or Jakarta EE application server, there might already be an implementation of JAX-WS included with it.

    Write your program against the JAX-WS API, and not against a particular implementation, unless you need to use non-standard extensions of a particular implementation (but that will, of course, make it hard to switch to a different implementation later).