New candidate JEP: 493: Linking Run-Time Images without JMODs

Severin Gehwolf sgehwolf at redhat.com
Tue Oct 22 19:09:59 UTC 2024


On Tue, 2024-10-22 at 10:28 -0700, Alex Buckley wrote:
> > Every jlink in every JDK build can consume JMOD files. 
> 
> It would be helpful to state this. And then: "In addition, in some JDK 
> installations, jlink can consume modules from the run-time image of 
> which it is part. Whether jlink can do this depends on how its run-time 
> image was built."

OK.

> > jlink support for using the packaged modules in another JDK is very
> > limited. You can do this today:
> > 
> >    $JDK1/bin/jlink --module-path $JDK2/jmods --add-modules java.se -- 
> > output myjdk
> > 
> > but only if $JDK1 and $JDK2 are the same version, otherwise you get an 
> > error like "Error: jlink version 24.0 does not match target java.base 
> > version 22.0".
> 
> I might have a variety of run-time images installed on my (say) Windows 
> machine, so it would be convenient if I could consume modules from one 
> or more of those images when building a new run-time image -- I wouldn't 
> need to ask anyone for JMOD files. This scenario is completely unrelated 
> to cross-platform linking.
> 
> I see now that this scenario is not supported because I can't point 
> --module-path to another run-time image, only to a location of JMODs. It 
> would be helpful if the JEP stated this plainly, rather than expecting 
> readers to know everything about jlink and then apply an "Unchanged 
> unless we say otherwise" filter.

I will add a clarifying sentence about this.

Thanks,
Severin



More information about the jigsaw-dev mailing list