Skip to content

Java 24 Restricted/Deprecated methods #1056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
saullo opened this issue Apr 1, 2025 · 1 comment
Open

Java 24 Restricted/Deprecated methods #1056

saullo opened this issue Apr 1, 2025 · 1 comment

Comments

@saullo
Copy link

saullo commented Apr 1, 2025

Version

3.3.6

Platform

Windows x64

JDK

Oracle OpenJDK 24

Module

LWJGL Core

Bug description

I created a blank project using the new Java 24. I just initialized GLFW and OpenGL following the https://www.lwjgl.org/guide and the following warnings appeared in the console.

Stacktrace or crash log output

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.lwjgl.system.Library$$Lambda/0x000001f687008908 in an unnamed module (file:/C:/Users/saull/.m2/repository/org/lwjgl/lwjgl/3.3.6/lwjgl-3.3.6.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 terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.lwjgl.system.MemoryUtil (file:/C:/Users/saull/.m2/repository/org/lwjgl/lwjgl/3.3.6/lwjgl-3.3.6.jar)
WARNING: Please consider reporting this to the maintainers of class org.lwjgl.system.MemoryUtil
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

Process finished with exit code 0
@TheMrMilchmann
Copy link
Collaborator

Hi @saullo, thanks for the report! This is on our radar and will be solved in an upcoming (3.x.y) update which will use the new FFM API under the hood on recent Java versions.

Until this is available, I suggest ignoring or suppressing the warning using --sun-misc-unsafe-memory-access=false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants