问题
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.
来源:https://stackoverflow.com/questions/53806586/is-it-possible-to-use-jlink-on-jdk-11-to-make-a-runtime-including-the-java-se-ee