I have applied PR #160 so that we have initial support for JEP 493 enabled JDKs like Temurin 24. This works if the user supplies the list of modules; the SuggestedModulesBuilder class however still relies on the jmods being present so the list of modules cannot be determined automatically.
A quick outline to fully support JEP 493 (untested, suggested by AI Assistant, but seems doable):
What to do:
- Mount the runtime image via FileSystems.newFileSystem(URI.create("jrt:/"), Map.of()) or getFileSystem if already mounted.
- Iterate /modules//module-info.class.
- For each module-info.class, read bytes and call ModuleDescriptor.read(InputStream).
- Collect md.exports().stream().map(Exports::source) per module.
Why this works:
- It uses only public APIs and works for both: JDKs with jmods and JDKs without them (using the modules image).
- No dependency on internal jimage APIs or on the existence of $JAVA_HOME/jmods.
- Works on any modular JDK.
I have applied PR #160 so that we have initial support for JEP 493 enabled JDKs like Temurin 24. This works if the user supplies the list of modules; the
SuggestedModulesBuilderclass however still relies on the jmods being present so the list of modules cannot be determined automatically.A quick outline to fully support JEP 493 (untested, suggested by AI Assistant, but seems doable):