EsotericSoftware / kryo

Java binary serialization and cloning: fast, efficient, automatic
BSD 3-Clause "New" or "Revised" License
6.18k stars 822 forks source link

Massive jump from Java 8 to requiring Java 17 in a patch release (5.6.0 -> 5.6.1) #1134

Open nielsbasjes opened 2 hours ago

nielsbasjes commented 2 hours ago

Describe the bug With the update from 5.6.0 to 5.6.1 there is a massive jump in the required JRE to use this software. Such a jump would make sense when going to Kryo 6.0.0, not when doing a patch release.

To Reproduce

On my Linux system;

wget https://repo1.maven.org/maven2/com/esotericsoftware/kryo/5.6.0/kryo-5.6.0.jar
unzip kryo-5.6.0.jar
file com/esotericsoftware/kryo/Kryo.class

outputs

com/esotericsoftware/kryo/Kryo.class: compiled Java class data, version 52.0 (Java 1.8)

and

wget https://repo1.maven.org/maven2/com/esotericsoftware/kryo/5.6.1/kryo-5.6.1.jar
unzip kryo-5.6.1.jar
file com/esotericsoftware/kryo/Kryo.class

outputs

com/esotericsoftware/kryo/Kryo.class: compiled Java class data, version 61.0

Java class version 61 is Java 17

Additional context My renovate update build https://github.com/nielsbasjes/yauaa/actions/runs/11252889050/job/31286989023?pr=1598 fails with

[INFO] Restricted to JDK 8 yet com.esotericsoftware:kryo:jar:5.6.1:compile contains com/esotericsoftware/kryo/ClassResolver.class targeted to JDK 17

nielsbasjes commented 2 hours ago

My personal recommendation is to use the maven toolchains plugin to ensure the correct Java versions are used.

As you can see in this demonstrator project I created a while ago you can run the maven under Java 21 (so you can us all modern plugins) and still run the actual Java 8 (or which ever you want) compiler to build the code. This also shows how you can then run integration tests under several different JDK versions.

https://github.com/nielsbasjes/ToolChainsInCiBuilds

theigl commented 1 hour ago

Thanks for reporting this!

I'm not sure how this happened. I guess one of the Maven Plugin updates is responsible.

We are currently using build-helper-maven-plugin for targeting different JDK versions and this used to work just fine.

I will look into this and release a new version asap.