6

When I try to include java.xml.bind in my runtime I get an error message:

Error: automatic module cannot be used with jlink: java.activation from file:...[url to javax.activation-api-1.2.0.jar in my gradle cache]

I'm using these artifacts on the module-path:

"javax.xml.bind:jaxb-api:2.4.0"
"org.glassfish.jaxb:jaxb-runtime:2.4.0-b180830.0438"

It seems that with JDK 11, modules were removed but no fully-modularized replacements have been made available. So jlink can't make a runtime from them.

Why weren't the external replacements properly modularized, given that they were already modules in JDK 10?

Not only is java.activation still not modularized, it has a new module name, "jakarta.activation". See https://eclipse-ee4j.github.io/jaf/#Latest_News I believe that further breaks things, as everything that depends on that module will have to change again before jlink will run.

swpalmer
  • 3,890
  • 2
  • 23
  • 31
  • I don’t know about getting them via Gradle, but you can always use the java.activation.jmod and java.xml.bind.jmod from a Java 10 JDK. – VGR Dec 17 '18 at 01:16
  • 1
    The idea behind their removal was very well broadcasted by marking them `@Deprecated forRemoval` in Java9. Yet, I would say that's the least users could expect(modularisation), of a module moved out of JDK. As to the question seemingly specific to a target audience which shall include more developers and contributors of the JDK, rather than just consumers, I would suggest you move this to a mailing list or maybe comment and vote for such issues on the repositories where people have pointed this out already, [for e.g. this](https://github.com/eclipse-ee4j/jaf/issues/13#issuecomment-437807263). – Naman Dec 17 '18 at 01:39

0 Answers0