jlink 14.0.1 with 100 modules fail
Remi Forax
forax at univ-mlv.fr
Sat May 30 17:05:44 UTC 2020
----- Mail original -----
> De: "Christian Stein" <sormuras at gmail.com>
> À: "jigsaw-dev" <jigsaw-dev at openjdk.java.net>
> Envoyé: Samedi 30 Mai 2020 18:40:53
> Objet: jlink 14.0.1 with 100 modules fail
> Hi,
>
> the modular [bach-demo-99] I generated to check my build tool
> against, failed to create a custom runtime image using jlink
> via itsToolProvider-based service entry-point.
>
> The project consists of 100 module descriptors. No other Java
> source files (for classes and interfaces) are part of that demo.
> Each descriptor ball${i}n declares a "requires ball${j}n;" with j
> set to a number from 0 to i-1 ... in words, all lower modules.
>
> javac compiles this project with problems.
>
> Arguments passed to jlink (as an array of string) reads:
>
> jlink
> --add-modules ball27n,ball43n,ball88n,[...],ball77n,ball93n
> --module-path .bach\workspace\modules
> --output .bach\workspace\image
> --compress 2
> --no-header-files
> --no-man-pages
>
> The error message reads:
>
> jdk.internal.org.objectweb.asm.MethodTooLargeException: Method too large:
> jdk/internal/module/SystemModules$all.moduleDescriptors
> ()[Ljava/lang/module/ModuleDescriptor;
>
> Is there a limitation of supported modules that can be linked?
It's a bug in the implementation,
jlink pre-resolve the module graph and encodes it in a generated classfile.
The fact that that classfile can have a method too big was overlooked.
> Is the module graph of this conceived project too far out of scope?
>
> Shall I open an issue at JBS?
yes !
>
> Cheers,
> Christian
regards,
Rémi
>
> [ bach-demo-99]:
> https://github.com/sormuras/bach/blob/master/src/bach/bach-demo-99.jsh
More information about the jigsaw-dev
mailing list