Skip to content

Java 25: terminally deprecated warning from sun.misc.Unsafe #384

@Uhuli

Description

@Uhuli

Description

When using JOML 1.10.8 on a modern JDK (e.g. Java 24/25), a "terminally deprecated" warning is emitted due to the use of sun.misc.Unsafe::objectFieldOffset.

With the ongoing work on JEP 471, several memory access methods in sun.misc.Unsafe are deprecated for removal. This may cause compatibility issues or breakage in future Java releases if JOML does not migrate to supported alternatives such as VarHandle or MemorySegment.

Reference: https://openjdk.org/jeps/471

Steps to Reproduce

  1. Use org.joml:joml:1.10.8
  2. Run on a JDK that emits warnings for deprecated Unsafe usage (e.g. Java 25 or recent EA builds).
  3. Execute code that triggers initialization of org.joml.MemUtil.

Log Output

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.joml.MemUtil$MemUtilUnsafe (file:/data/libraries/org/joml/joml/1.10.8/joml-1.10.8.jar)
WARNING: Please consider reporting this to the maintainers of class org.joml.MemUtil$MemUtilUnsafe
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions