According to https://openjdk.org/jeps/261
<quote>
Increasing readability
When testing and debugging it is sometimes necessary to arrange for one module to read some other module, even though the first module does not depend upon the second via a requires clause in its module declaration. This may be needed to, e.g., enable a module under test to access the test harness itself, or to access libraries related to the harness. The --add-reads option can be used, at both compile time and run time, to do this. Its syntax is:
--add-reads <source-module>=<target-module>
where <source-module> and <target-module> are module names.
</quote>
In JDK 24, if an AOT cache is built with -XX:+AOTClassLinking (which is the default), the cache will not be useable if --add-reads is used for testing purposes as described above. This might hinder testing (e.g., for bugs that show up only when the AOT cache is enabled).
========
Proposal: Support --add-reads for AOT caches created with -XX:+AOTClassLinking, as long as identical setting is applied to the training/assembly/production runs.
========
Work around: create AOT cache with -XX:-AOTClassLinking, but this will significantly limit the amount of available AOT optimizations.
<quote>
Increasing readability
When testing and debugging it is sometimes necessary to arrange for one module to read some other module, even though the first module does not depend upon the second via a requires clause in its module declaration. This may be needed to, e.g., enable a module under test to access the test harness itself, or to access libraries related to the harness. The --add-reads option can be used, at both compile time and run time, to do this. Its syntax is:
--add-reads <source-module>=<target-module>
where <source-module> and <target-module> are module names.
</quote>
In JDK 24, if an AOT cache is built with -XX:+AOTClassLinking (which is the default), the cache will not be useable if --add-reads is used for testing purposes as described above. This might hinder testing (e.g., for bugs that show up only when the AOT cache is enabled).
========
Proposal: Support --add-reads for AOT caches created with -XX:+AOTClassLinking, as long as identical setting is applied to the training/assembly/production runs.
========
Work around: create AOT cache with -XX:-AOTClassLinking, but this will significantly limit the amount of available AOT optimizations.
- relates to
-
JDK-8352003 Support --add-opens with -XX:+AOTClassLinking
-
- Open
-
-
JDK-8352437 Support --add-exports with -XX:+AOTClassLinking
-
- Resolved
-