-
Enhancement
-
Resolution: Duplicate
-
P3
-
jfx24
JEP 472 [0] is a step along the path to restricting JNI access by default.
When running JavaFX applications with JDK 24, the Java runtime emits the illegal access warnings of the following form:
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.glass.utils.NativeLibLoader in module javafx.graphics (file:.../javafx.graphics.jar)
WARNING: Use --enable-native-access=javafx.graphics to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
WARNING: A native method in com.sun.webkit.WebPage has been bound
WARNING: com.sun.webkit.WebPage::twkInitWebCore is declared in module javafx.web (file:.../javafx.web.jar)
WARNING: Use --enable-native-access=javafx.web to avoid a warning for native methods declared in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
WARNING: A native method in com.sun.media.jfxmedia.logging.Logger has been bound
WARNING: com.sun.media.jfxmedia.logging.Logger::nativeSetNativeLevel is declared in module javafx.media (file:.../javafx.media.jar)
WARNING: Use --enable-native-access=javafx.media to avoid a warning for native methods declared in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
In order to avoid those warnings, and to avoid the eventual errors in the future, applications must pass the --enable-native-access flag:
--enable-native-access=javafx.graphics,javafx.media,javafx.web
[0] https://openjdk.org/jeps/472
When running JavaFX applications with JDK 24, the Java runtime emits the illegal access warnings of the following form:
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.glass.utils.NativeLibLoader in module javafx.graphics (file:.../javafx.graphics.jar)
WARNING: Use --enable-native-access=javafx.graphics to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
WARNING: A native method in com.sun.webkit.WebPage has been bound
WARNING: com.sun.webkit.WebPage::twkInitWebCore is declared in module javafx.web (file:.../javafx.web.jar)
WARNING: Use --enable-native-access=javafx.web to avoid a warning for native methods declared in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
WARNING: A native method in com.sun.media.jfxmedia.logging.Logger has been bound
WARNING: com.sun.media.jfxmedia.logging.Logger::nativeSetNativeLevel is declared in module javafx.media (file:.../javafx.media.jar)
WARNING: Use --enable-native-access=javafx.media to avoid a warning for native methods declared in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
In order to avoid those warnings, and to avoid the eventual errors in the future, applications must pass the --enable-native-access flag:
--enable-native-access=javafx.graphics,javafx.media,javafx.web
[0] https://openjdk.org/jeps/472
- duplicates
-
JDK-8331671 Implement JEP 472: Prepare to Restrict the Use of JNI
-
- Resolved
-
- relates to
-
JDK-8347752 Running RichTextArea demos via ant on JDK 24 prints warnings
-
- Resolved
-
-
JDK-8339517 Add --enable-native-access flag when running tests
-
- Resolved
-