WARNING: A restricted method in java.lang.System has been called

Kevin Rushforth kevin.rushforth at oracle.com
Tue Jul 29 12:17:10 UTC 2025


This isn't a bug, but is the expected behavior of libraries or 
applications that use JNI or FFM native calls after JEP 472 [1]. 
Applications must now specify 
`--enable-native-access=<list-of-modules>`  as indicated in the JavaFX 
24 release notes [2]. See JDK-8347744 [3] for more information. Failure 
to do so will print a warning with JDK 24 and JDK 25, and will fail in 
the future.

--Kevin

[1] https://openjdk.org/jeps/472
[2] 
https://github.com/openjdk/jfx/blob/master/doc-files/release-notes-24.md#javafx-applications-must-use---enable-native-access
[3] https://bugs.openjdk.org/browse/JDK-8347744

On 7/29/2025 3:32 AM, Davide Perini wrote:
> Will this be fixed soon?
>
> Thanks
>
> ```
> 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:/C:/Users/sblantipodi/.m2/repository/org/openjfx/javafx-graphics/24/javafx-graphics-24-win.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
> ```
>
>



More information about the openjfx-dev mailing list