# Running on Java 9

In Java Platform Module System (JPMS) coming with Java SE 9, both rt.jar and endorsed mechanism were removed. JAXB technology now comes in `java.xml.bind` and `jdk.xml.bind` JPMS modules.

Bundled version in Java SE can be used by adding java.xml.bind / jdk.xml bind to module graph, e.g. depending on those modules if application is loaded as JPMS module, or adding them with command line --add-modules java.xml.bind,jdk.xml.bind

In order to use standalone version of JAXB, java.xml.bind should be upgraded with `jaxb-api` module. Implementation jars jaxb-core and jaxb-impl are not modularized yet and should be placed on classpath to be run as `unnamed` module.

Using standalone JAXB from classpath as `unnamed` module. This example assumes java.xml.bind bundled in Java SE 9 is not resolved in module graph. Module java.activation is added to module graph here, it is used by jaxb implementation.

                java -cp jaxb-api.jar:jaxb-impl.jar:jaxb-core.jar --add-modules java.activation

Using standalone JAXB with java.xml.bind module upgraded. Module java.xml.bind is upgraded with jaxb-api, implementation is still loaded from classpath.

                --upgrade-module-path jaxb-api.jar -cp jaxb-core.jar:jaxb-impl.jar

                --upgrade-module-path jaxb-api.jar -cp jaxb-core.jar:jaxb-impl.jar

Known issue: If client module is loaded as JPMS named module, than also one of the options must be included: `--add-reads foo.mymodule=ALL-UNNAMED` or `-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true` This is because JAXB implementation updates client Pojo properties at runtime to extend `com.sun.xml.bind.v2.runtime.reflect.Accessor` Supposed to be fixed in future updates.

Known issue: Implementation and tool jars jaxb-core, jaxb-impl, jaxb-xjc and jaxb-jxc contain split packages and cannot be used as JPMS automatic modules. Supposed to be fixed in future updates.