For those following the problem I'm encountering with a legacy app, after unsuccessfully trying Java 21 to see if that improved the reliability of videos played in MediaView under Win11, I thought I'd try Java 24.
While the app compiles and runs, the following warnings are being thrown:
These point to future problems with methods used to be blocked, although these warnings also reporting in this post appear to have just been dismissed, but they do prompt the questions:
UPDATE:
The above warnings appear when running the app in the IDE, but running the compiled app via run_debug.bat the following additional warning is thrown:
So how do I "enable-native-access=b4j"?
While the app compiles and runs, the following warnings are being thrown:
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:/Java24/jdk-24/bin/../javafx/lib/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 terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by com.sun.marlin.OffHeapArray (file:/C:/Java24/jdk-24/bin/../javafx/lib/javafx.graphics.jar)
WARNING: Please consider reporting this to the maintainers of class com.sun.marlin.OffHeapArray
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.scijava.nativelib.NativeLoader in an unnamed module (file:/D:/Users/Public/Documents/Bryon/Java/BDSPlayerBoard/BDSSynergyPlayerBoardV21/Objects/BDSSynergyPlayerBoard.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
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:/C:/Java24/jdk-24/bin/../javafx/lib/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
These point to future problems with methods used to be blocked, although these warnings also reporting in this post appear to have just been dismissed, but they do prompt the questions:
- How do I "enable-native-access=javafx.graphics", "enable-native-access=ALL-UNNAMED" and "enable-native-access=javafx.media"?
- What do I do about the "A terminally deprecated method in sun.misc.Unsafe has been called warning"?
UPDATE:
The above warnings appear when running the app in the IDE, but running the compiled app via run_debug.bat the following additional warning is thrown:
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.scijava.nativelib.NativeLoader in module b4j (jrt:/b4j)
WARNING: Use --enable-native-access=b4j to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
So how do I "enable-native-access=b4j"?
Last edited: