raphw / byte-buddy

Runtime code generation for the Java virtual machine.
https://bytebuddy.net
Apache License 2.0
6.09k stars 781 forks source link

ByteBuddy is incompatible with CDS due to the Java 6 baseline #1657

Open sdeleuze opened 2 weeks ago

sdeleuze commented 2 weeks ago

When running an application and Spring Boot 3.3 CDS support and Bytebuddy (typically Spring Data JPA applications like Petclinic), a lot of warnings are visible in the logs like [warning][cds] Skipping net/bytebuddy/description/type/TypeDefinition: Old class has been linked. I think this is due to the Java 6 baseline used by ByteBuddy, a Java 8 baseline would make ByteBuddy CDS compliant.

raphw commented 2 weeks ago

Byte Buddy is used in a lot of tooling which normally needs to support older VMs, too. Not sure why the class data sharing excludes old class files, but for now I think the benefits of an old class file format out weight the negatives.

odrotbohm commented 2 weeks ago

Would a multi-release JAR be a path out of this?

raphw commented 2 weeks ago

That would work, would however double the jar size. Possibly I could offer two artifacts. I will look into that.

Does class data sharing even support MR jars?

sdeleuze commented 20 hours ago

Yes, I got the confirmation from the Java Platform team that MR jars would solve this. See also the related issue https://bugs.openjdk.org/browse/JDK-8288334.