How to add java.xml.bind (jaxb) as a module in java 11?

Viewed 15459

I'm already switching java version from 8 to 11 in one of the project and facing with the problem with removed ee modules (jeps320).

I'm using gradle to build the project and added as a runtime dependency 'org.glassfish.jaxb:jaxb-runtime:2.4.0-b180830.0438'

and I have this jar inside created project spring boot fat jar in the library. Unfortunatelly I got th following expcetion

javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
 - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]

(I didn"t add java.xml.bind to the module-info and when I'm trying to start an app from command line with the switche --add-modules="java.xml.bind" I got an error.

java.lang.module.FindException: Module javax.xml.bind not found

Any idea? How to solve this?

0 Answers
Related