0__
0__

Reputation: 67290

sbt / native-packager, new jdeps error: java.lang.module.FindException: Module java.activation not found, required by java.xml.bind

I have not changed my setup as far as I can see. As of today, trying to run sbt native packager with jlink gives this error:

[info] Running: jdeps --multi-release 11 -R ...
[error] Exception in thread "main" java.lang.module.FindException: Module java.activation not found, required by java.xml.bind
[error]     at java.base/java.lang.module.Resolver.findFail(Resolver.java:877)
[error]     at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
[error]     at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
[error]     at java.base/java.lang.module.Configuration.resolve(Configuration.java:422)
[error]     at java.base/java.lang.module.Configuration.resolve(Configuration.java:256)
[error]     at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
[error]     at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
[error]     at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
[error]     at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
[error]     at jdk.jdeps/com.sun.tools.jdeps.Main.run(Main.java:64)
[error]     at jdk.jdeps/com.sun.tools.jdeps.Main$JDepsToolProvider.run(Main.java:73)
[error]     at java.base/java.util.spi.ToolProvider.run(ToolProvider.java:137)
[error]     at ru.eldis.toollauncher.ToolLauncher.runTool(ToolLauncher.java:68)
[error]     at ru.eldis.toollauncher.ToolLauncher.lambda$main$1(ToolLauncher.java:33)
[error]     at ru.eldis.toollauncher.ToolLauncher.main(ToolLauncher.java:48)

How do I fix this? I tried adding javax.activation to libraryDependencies, that doesn't seem to have any effect or anything to do with this problem.


Edit: The root problem of seems to be my dependency on Pi4j 1.4, which depends on javax.xml.bind:jaxb-api which in turn depends on javax.activation:javax.activation-api. Now I don't understand much of this Java module stuff, but javax.activation-api does exist on Maven, so why does jdeps complain? If I exclude javax.xml.bind, it works, but now I'm worried I'm actually missing stuff on the class path.

Upvotes: 2

Views: 993

Answers (1)

Silta
Silta

Reputation: 99

javax.activation has been removed since java 11. To fix it you can:

  • Download the javax.activation jar and run the command by adding this jar on module path:

    jdeps --multi-release 11 -R --module-path path\to\javax.activation.jar ...

  • Running this command with java 8 jdeps

Upvotes: 0

Related Questions