XML Binding (JAXB) Modules

According to the release-notes, Java 11 removed the java.xml.bind (JAXB) that are part of Jakarta EE and were present in Java 10 and older. See JEP 320 for more info.

If you need these modules, use standalone versions of these modules. You can add additional Maven dependencies that contain the classes you need, get those modules

You don’t need to do anything to deploy your application to a Jakarta EE server if you already have an application WAR or EAR file. GlassFish and other servers already contain the JAXB modules and your application can work on Java 11 or older in the same way as it worked on Java 8 before.

Eclipse GlassFish 7

You can get all the required modules from a GlassFish installation. In GlassFish 7, you can find them at this location:

  • Jakarta EE 10 API: glassfish/modules/jakarta.xml.bind-api.jar
  • Implementation: glassfish/modules/jaxb-osgi.jar

If you need to add them as a Maven dependency, use the Jakarta EE 10 ones as described below.

Jakarta EE 10

With Jakarta EE 10, use Jakarta XML Binding 4.0.

Standalone JAR files

Maven dependencies

<dependency>
  <groupId>jakarta.xml.bind</groupId>
  <artifactId>jakarta.xml.bind-api</artifactId>
  <version>4.0.1</version>
</dependency>
<dependency>
  <groupId>com.sun.xml.bind</groupId>
  <artifactId>jaxb-impl</artifactId>
  <version>4.0.4</version>
  <scope>runtime</scope>
</dependency>

Jakarta EE 9

With Jakarta EE 9, use Jakarta XML Binding 3.0:

Standalone JAR files

Maven dependencies

<dependency>
  <groupId>jakarta.xml.bind</groupId>
  <artifactId>jakarta.xml.bind-api</artifactId>
  <version>3.0.0</version>
</dependency>
<dependency>
  <groupId>com.sun.xml.bind</groupId>
  <artifactId>jaxb-impl</artifactId>
  <version>3.0.0</version>
  <scope>runtime</scope>
</dependency>

Jakarta EE 8

With Jakarta EE 8, use Jakarta XML Binding 2.3. This version is the last one that uses the Java package javax.xml.bind and not jakarta.xml.bind.

Standalone JAR files

Maven dependencies

<dependency>
  <groupId>jakarta.xml.bind</groupId>
  <artifactId>jakarta.xml.bind-api</artifactId>
  <version>2.3.3</version>
</dependency>
<dependency>
  <groupId>com.sun.xml.bind</groupId>
  <artifactId>jaxb-impl</artifactId>
  <version>2.3.3</version>
  <scope>runtime</scope>
</dependency>