I have an explicit modular project which is dependent on an automatic module; e.g. on java.activation. Is it still possible to use jlink?
See this module-info.java:
module hello {
requires java.activation;
}
Then jlink can't add the module:
$ jlink --module-path target/modules --add-modules hello --output target/jlink
Error: automatic module cannot be used with jlink: java.activation from file:///C:/Development/jlinkExample/target/modules/javax.activation-api-1.2.0.jar
From my understanding, an automatic module would contain the whole classpath anyway. So I guess there would be no benefit to creating a runtime image with jlink?
See also: What is an automatic module?
Are there any possibilities to circumvent this issue? Maybe generating a module-info.java for those dependencies?