Skip to content

Timeline for Unsafe deprecation #1915

Description

@cushon

5821ccc

Cannot define class using reflection: As of Java 26, using Unsafe is disabled by default, set net.bytebuddy.safe to true if you want to use the JVM's internal unsafe API even though it will become unsupported in the future and should be replaced by injection using method handles: net.bytebuddy.dynamic.loading.ClassInjector$UsingLookup

This was also mentioned in the release notes for 1.18.19

Disable use of Unsafe by default when Java 25 or newer is discovered.

Is there a timeline for when this functionality will become unsupported by bytebuddy?

I noticed this because it affects some code that is using ClassLoadingStrategy.Default.INJECTION to create proxies for classes in java.base that it isn't possible to get a private lookup for.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions