JEP 498 [0] prints a warning on use of any memory-access methods in sun.misc.Unsafe in JDK 24. When running JavaFX applications or test programs with JDK 24, we now get warnings that we are using a terminally deprecated method of sun.misc.Unsafe as follows:
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:.../build/shims/javafx.graphics/)
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
Eliminating the use of sun.misc.Unsafe memory access methods by Marlin is being tracked by JDK-8334137 (see also JDK-8345121). As a workaround, until JDK-8334137 is fixed, we need to pass the following flag when running tests:
--sun-misc-unsafe-memory-access=allow
This flag is only recognized on JDK 23 and later, so we will qualify passing this flag based on the version of the JDK used to run the tests.
[0] https://openjdk.org/jeps/498
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:.../build/shims/javafx.graphics/)
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
Eliminating the use of sun.misc.Unsafe memory access methods by Marlin is being tracked by JDK-8334137 (see also JDK-8345121). As a workaround, until JDK-8334137 is fixed, we need to pass the following flag when running tests:
--sun-misc-unsafe-memory-access=allow
This flag is only recognized on JDK 23 and later, so we will qualify passing this flag based on the version of the JDK used to run the tests.
[0] https://openjdk.org/jeps/498
- relates to
-
JDK-8347752 Running RichTextArea demos via ant on JDK 24 prints warnings
- Resolved
-
JDK-8334137 Marlin: replace terminally deprecated sun.misc.Unsafe memory access methods
- Open
-
JDK-8345121 JavaFX: WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
- Open
- links to
-
Commit(master) openjdk/jfx/5279be65
-
Review(master) openjdk/jfx/1650