Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK 21 support #1396

Closed
johanjanssen opened this issue Jan 26, 2023 · 23 comments
Closed

JDK 21 support #1396

johanjanssen opened this issue Jan 26, 2023 · 23 comments
Assignees
Labels
Milestone

Comments

@johanjanssen
Copy link

Hi, I know I'm quite early :), but is support for JDK 21 already planned?

I ran the following example https://github.com/johanjanssen/JavaHiddenGems/tree/main/Examples/equalsverifier on an ea version of Java 21. It uses EqualsVerifier https://jqno.nl/equalsverifier/ which in turn uses Byte Buddy and produces the following error:

-> Java 21 (65) is not supported by the current version of Byte Buddy which officially supports Java 20 (64) - update Byte Buddy or set net.bytebuddy.experimental as a VM property

@raphw
Copy link
Owner

raphw commented Jan 26, 2023

For now, please set -Dnet.bytebuddy.experimental=true

Then it will work. Proper support is coning soon.

@raphw raphw self-assigned this Jan 26, 2023
@raphw raphw added the question label Jan 26, 2023
@raphw raphw added this to the 1.12.22 milestone Jan 26, 2023
@johanjanssen
Copy link
Author

Yes, I'm using that now indeed. Thanks a lot for working on supporting Java 21 and the great work on Byte Buddy in general!

@kennymacleod
Copy link

With the release of JDK 20 yesterday, 21 LTS is next up. Do you have an updated target release of byte-buddy?

@raphw
Copy link
Owner

raphw commented Mar 23, 2023

I'm waiting a bit on ASM here, unfortunately. The day they release support, I'll follow.

@kennymacleod
Copy link

ASM 9.5 is out in the wild. Aww yeah.

@raphw
Copy link
Owner

raphw commented Mar 28, 2023

Releasing as we speak.

@raphw raphw closed this as completed Apr 11, 2023
@ascopes
Copy link

ascopes commented May 6, 2023

@raphw random question, hope you don't mind me asking here.

Would specifying this flag enable JDK 21 build support for Mockito, given it uses ByteBuddy internally?

@raphw
Copy link
Owner

raphw commented May 8, 2023

It is supported in the latest Byte Buddy version. Mockito should have picked that up?

@bergerdenes
Copy link

Java 21 was out a few weeks ago, please give an update on when it will be officially supported. Thanks!

@raphw
Copy link
Owner

raphw commented Oct 3, 2023

It's been supported for a while, are you experiencing issues?

@OLibutzki
Copy link

@raphw The milestone assigned to this issue is misleading. As far as I can see it's not included in 1.12.22?

ASM has been updated with 1.14.3, so this is the version containg Java 21 support, right?

copybara-service bot pushed a commit to GoogleCloudPlatform/appengine-java-standard that referenced this issue Oct 9, 2023
trying to address raphw/byte-buddy#1396 as well.

PiperOrigin-RevId: 572035592
Change-Id: I9f6fe1ad19c78384ac5be7a4a147420aaf7363a5
@alphaho
Copy link

alphaho commented Oct 16, 2023

@OLibutzki Cross checking the release timeline and the discussion in this issue, I think the JDK 21 support is from version 1.14.3

@JavedAkramGit
Copy link

Hi, I have been facing an issue related to the upgraded version of Byte-Buddy(1.14.3) while hosting keycloak on my mac -> this was the issue when i tried to start it -> ERROR: java.util.concurrent.ExecutionException: org.hibernate.bytecode.enhance.spi.EnhancementException: Failed to enhance class org.keycloak.models.jpa.entities.ClientScopeAttributeEntity
ERROR: org.hibernate.bytecode.enhance.spi.EnhancementException: Failed to enhance class org.keycloak.models.jpa.entities.ClientScopeAttributeEntity
ERROR: Failed to enhance class org.keycloak.models.jpa.entities.ClientScopeAttributeEntity
ERROR: Java 21 (65) is not supported by the current version of Byte Buddy which officially supports Java 20 (64) - update Byte Buddy or set net.bytebuddy.experimental as a VM property
So i tried to upgrade the version of Byte buddy by downloading the latest version and moving it to the lib folder under keycloak but still facing the same issue.Please assist

@raphw
Copy link
Owner

raphw commented Nov 15, 2023

I assume you are still using an outdated version.

@JavedAkramGit
Copy link

I updated it to 1.14.3 but faced a similar issue. Please assist in updating it in another way compatible with KeyCloak

@ascopes
Copy link

ascopes commented Nov 15, 2023

The latest version of Mockito is 5.x, so if you are on 1.x then that is very outdated

@JavedAkramGit
Copy link

Not sure how am I gonna incorporate mockito while hosting keycloak on my local. The issue is that apparently keycloak requires an updated version of Byte-Buddy and the latest version from maven is 1.14 har file. Please assist with regards to that

@raphw
Copy link
Owner

raphw commented Nov 16, 2023

You should be able to just update Byte Buddy which is published to Maven Central.

@antemo
Copy link

antemo commented Dec 20, 2023

We are using Mockito 5.8.0 which brings in bytebuddy version 1.14.10
When trying to run tests on JDK 21 we get same error as mentioned before:

Caused by: java.lang.IllegalArgumentException: Java 21 (65) is not supported by the current version of Byte Buddy which officially supports Java 20 (64) - update Byte Buddy or set net.bytebuddy.experimental as a VM property

How can we fix or avoid this issue?

@ascopes
Copy link

ascopes commented Dec 20, 2023

@antemo in my builds, I specify that flag on the Maven argline as a JVM property for the test runner.

<properties>
  <argLine>-Dnet.bytebuddy.experimental=true</argLine>
</properties>

I have stuff building on JDK 21 and JDK 22 EA, and haven't come across this issue.

I was meaning to remove that flag as it was a workaround from a while back but might leave it in if it is keeping builds stable.

@raphw
Copy link
Owner

raphw commented Dec 20, 2023

Have you checked with your dependency manager if the version of Byte Buddy that is used is the right one? If another library then Mockito uses Byte Buddy, a different version might be resolved.

@listeningALF
Copy link

listeningALF commented Apr 23, 2024

What do I have to do exactly?
I am using an Macbook Pro and am working in IntelliJ.

For now, please set -Dnet.bytebuddy.experimental=true

Then it will work. Proper support is coning soon.

@ascopes
Copy link

ascopes commented Apr 23, 2024

@listeningALF the JVM arguments for your test runner.

No idea about Gradle. In Maven you can just set a property called argLine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants