Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

JVM 25 warning - remove usage of sun.misc.Unsafe

Open
#9,681 6 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
backend

Research direction

Start by reproducing the Java 25 startup warning with dd-trace-java 1.53.0 and trace the reported net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction call in datadog-agent.jar. Compare the related OpenTelemetry issue and identify where the agent or dependency invokes sun.misc.Unsafe; done means startup produces no such warning on Java 25.

Written by the indexing model from the issue text.

Description

type: bug report
Tracer Version(s)

1.53.0

Java Version(s)

25.0.0

JVM Vendor

Amazon Corretto

Bug Report

We are starting to use Java 25 with a bunch of projects and saw this warning block at the top of the output:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction (file:/usr/local/datadog-agent.jar)
WARNING: Please consider reporting this to the maintainers of class net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

I think this is similar to https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/13375, would be nice if we could get rid of this warning and make the agent future proof. Maybe this is even coming from OpenTelemetry directly, feel free to close this issue then.

Expected Behavior

No warning during startup

Reproduction Code

No response

Dominant language
Java
Stars
737
Forks
361
Avg merge
3d 20h
Merged PRs (30d)
173

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/dd-trace-java

All issues in DataDog/dd-trace-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.