Skip to content

sun.misc.Unsafe::objectFieldOffset deprecation warning on JDK 25 #2753

@sureshg

Description

@sureshg

Using KSP with Amper build on JDK 25 produces terminal deprecation warnings.

Environment:

  • Amper (latest)
  • JDK 25
  • Kotlin 2.3.0
  • KSP 2.3.4
00:41.990 ERROR :ktor:kspJvmTest          [ksp] WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
00:41.991 ERROR :ktor:kspJvmTest          [ksp] WARNING: sun.misc.Unsafe::objectFieldOffset has been called by ksp.com.intellij.util.containers.Unsafe (file:/../Library/Caches/JetBrains/Amper/.m2.cache/com/google/devtools/ksp/symbol-processing-aa-embeddable/2.3.4/symbol-processing-aa-embeddable-2.3.4.jar)
00:41.993 ERROR :ktor:kspJvmTest          [ksp] WARNING: Please consider reporting this to the maintainers of class ksp.com.intellij.util.containers.Unsafe
00:41.995 ERROR :ktor:kspJvmTest          [ksp] WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

This will become a runtime error when the method is removed from future JDK versions.

https://openjdk.org/jeps/471#sun-misc-Unsafe-memory-access-methods-and-their-replacements
https://openjdk.org/jeps/471#Migration-examples

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