Bug 1531 - OpenJDK 24: Pass '--enable-native-access=ALL-UNNAMED' to all unit test (JEP 472)
Summary: OpenJDK 24: Pass '--enable-native-access=ALL-UNNAMED' to all unit test (JEP 472)
Status: RESOLVED FIXED
Alias: None
Product: General
Classification: JogAmp
Component: builds (show other bugs)
Version: 2.6.0
Hardware: All all
: P4 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2025-08-30 11:08 CEST by Sven Gothel
Modified: 2025-08-30 11:37 CEST (History)
0 users

See Also:
Type: FEATURE
SCM Refs:
gluegen 0dea7cd41120291486f4906333bfe639ea1bc198 joal a16d1e631091a3eb27f6f10b7e7d279df6b3e8e2 jogl 92336365cd326cd6cb0da7940cee3f3f7f70cc7f jocl 92336365cd326cd6cb0da7940cee3f3f7f70cc7f
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2025-08-30 11:08:19 CEST
https://openjdk.org/jeps/472

Since JDK 17, the `java` command allowed passing '--enable-native-access=ALL-UNNAMED' (as well as '--add-open' etc).

Since JDK 24 the JVM is complaining about not having enabled such access
for certain java methods when called. See:

+++
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.jogamp.common.jvm.JNILibLoaderBase in an unnamed module (file:/usr/local/projects/JogAmp/gluegen/build-macosx/gluegen-rt.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
+++

Specify `jvmarg.modules` in GlueGen's make/jogamp-env.xml for all modules, 
also adding the '--add-open ...' directive for JOGL's' AWT access:

`--enable-native-access=ALL-UNNAMED --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.awt.windows=ALL-UNNAMED --add-opens java.desktop/sun.java2d=ALL-UNNAMED`

Also define jvmarg.generic = ${jvmarg.modules},
to be used for all `java` invocations of our unit tests.

Further supplement these arguments to our test scripts.
Comment 1 Sven Gothel 2025-08-30 11:37:31 CEST
resolved as described in all core modules