Moving to Java 9 - module-info.class not found for <module-name> module

forax at univ-mlv.fr forax at univ-mlv.fr
Sat Sep 2 11:43:19 UTC 2017


> De: "Rahman USTA" <rahman.usta.88 at gmail.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Alex Buckley" <alex.buckley at oracle.com>, "jigsaw-dev"
> <jigsaw-dev at openjdk.java.net>
> Envoyé: Samedi 2 Septembre 2017 13:30:24
> Objet: Re: Moving to Java 9 - module-info.class not found for <module-name>
> module

> Thank you, Remi and Alex.
> I think automatic modules can be supported by jlink. It could be a transition
> feature like --illegal-access imho.

The whole idea of jlink is that unlike classical Java it works under the assumption that the world is closed i.e. all the bytecodes that will be loaded is known, so it can do "whole world" optimizations like i know all the lambda forms that will be used by the string concatenation because i know all the call sites that does string concatenation so i can pre-generate them. 
If you have an automatic module, it can have dependencies on jars from the classpath, the close world assumption does not hold. 

If you are in a hacky mood, there is a simple solution to transform an automatic module to an explicit one, create a module-info.java, compile it and update the jar of the automatic module with the module-info.class or better ask the maintainer of the jar to do the work for you :) 

> Kind regards.

regards, 
Rémi 

> 2017-09-02 0:59 GMT+03:00 Remi Forax < [ mailto:forax at univ-mlv.fr |
> forax at univ-mlv.fr ] > :

>> As Alex said,
>> jackson.databind is not an explicit module.

>> You should report that issue to their bugtracker.

>> cheers,
>> Rémi

>> ----- Mail original -----
>>> De: "Alex Buckley" < [ mailto:alex.buckley at oracle.com | alex.buckley at oracle.com
>> > ] >
>>> À: "jigsaw-dev" < [ mailto:jigsaw-dev at openjdk.java.net |
>> > jigsaw-dev at openjdk.java.net ] >
>> > Envoyé: Vendredi 1 Septembre 2017 23:06:16
>>> Objet: Re: Moving to Java 9 - module-info.class not found for <module-name>
>> > module

>> > On 9/1/2017 1:21 PM, Rahman USTA wrote:
>> >> java --module-path
>> >> %JAVA_HOME%/jmods;target\terminalfx.jar;target\dependency --add-modules
>> >> terminalfx -m terminalfx/com.terminalfx.AppStarter

>> > (You shouldn't need the --add-modules, since terminalfx is already the
>> > main module.)

>> >> It works normally. Then, I want to generate a jlink image with the
>> >> following script

>> >> jlink --module-path
>> >> %JAVA_HOME%/jmods;target\terminalfx.jar;target\dependency --add-modules
>> >> terminalfx --launcher terminalfx=terminalfx/com.terminalfx.AppStarter
>> >> --output target/release

>> >> However it gives me the following error;

>> >> Error: module-info.class not found for jackson.databind module

>> > I suspect jackson.databind is an automatic module. jlink does not
>> > support linking of automatic modules because they can rely on the
>> > arbitrary content of the classpath, which goes against the idea of a
>> > self-contained Java runtime.

>> > Alex

> --
> Rahman USTA
> Istanbul JUG
> [ https://github.com/rahmanusta | https://github.com/rahmanusta ]


More information about the jigsaw-dev mailing list