-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
Comments
For now, please set -Dnet.bytebuddy.experimental=true Then it will work. Proper support is coning soon. |
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! |
With the release of JDK 20 yesterday, 21 LTS is next up. Do you have an updated target release of byte-buddy? |
I'm waiting a bit on ASM here, unfortunately. The day they release support, I'll follow. |
ASM 9.5 is out in the wild. Aww yeah. |
Releasing as we speak. |
@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? |
It is supported in the latest Byte Buddy version. Mockito should have picked that up? |
Java 21 was out a few weeks ago, please give an update on when it will be officially supported. Thanks! |
It's been supported for a while, are you experiencing issues? |
@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? |
trying to address raphw/byte-buddy#1396 as well. PiperOrigin-RevId: 572035592 Change-Id: I9f6fe1ad19c78384ac5be7a4a147420aaf7363a5
@OLibutzki Cross checking the release timeline and the discussion in this issue, I think the JDK 21 support is from version 1.14.3 |
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 |
I assume you are still using an outdated version. |
I updated it to 1.14.3 but faced a similar issue. Please assist in updating it in another way compatible with KeyCloak |
The latest version of Mockito is 5.x, so if you are on 1.x then that is very outdated |
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 |
You should be able to just update Byte Buddy which is published to Maven Central. |
We are using Mockito 5.8.0 which brings in bytebuddy version 1.14.10
How can we fix or avoid this issue? |
@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. |
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. |
What do I have to do exactly?
|
@listeningALF the JVM arguments for your test runner. No idea about Gradle. In Maven you can just set a property called argLine. |
This comment was marked as outdated.
This comment was marked as outdated.
Hi
Cant follow, sry.
Freundlich grüsst
Alfred Nrejaj
079 606 06 36
Maxim Podkolzine ***@***.***> schrieb am Fr., 7. Juni 2024,
11:05:
… Shouldn't mockito-inline be updated in mvn central? It still depends on
the old bytebuddy, hence doesn't work out of the box.
—
Reply to this email directly, view it on GitHub
<#1396 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6NYL4HNM2LYEZDQEI6QYU3ZGFZU5AVCNFSM6AAAAAAUHRC7TWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJUGQYTGMRXGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@FelixMarxIBM Mockito 5 uses the inline agent by default, so you need to just include mockito-core. If you are not on Mockito 5 I'd consider updating first. @listeningALF you need to set the JVM arguments for your test runner. I don't know what you are using so I can't provide further info, but you can most likely Google " set test JVM arguments" if you are not using Maven. |
saved my day. thanks a ton!! |
@raphw it is working when set -Dnet.bytebuddy.experimental=true. But how can we solve this problem ? We are using spring-boot-starter-test 2.7.18 and we want to upgrade to java 21 |
I assume you have an old version of Byte Buddy on the class path. Newer versions support Java 21 without this flag. |
@raphw org.mockito.mockito-core:4.5.1 is using in spring-boot-starter-test 2.7.18 and net.bytebuddy.byte-buddy:1.12.9 is using in org.mockito.mockito-core:4.5.1 |
Hey guys I am using Java21 with mockito-inline (latest version)
But I would like to not use this flag and use the latest bytebuddy version in mockito-inline I can use this for example (which works) but it looks somehow ugly:
|
@iSE-Timur-Ugurlu for now the best bet is to use the flag. I've had it set in my code for ages now. On Java 22, you'll also want to set |
The Byte Buddy version is up to date in Mockito at least: https://github.com/mockito/mockito/blob/a1cdede8ffdc1e62b20daf32f36ccc49d6cf75a7/gradle/dependencies.gradle#L7 The enable dynamic loading must be enabled, this cannot be worked around. |
trying to address raphw/byte-buddy#1396 as well. PiperOrigin-RevId: 572035592 Change-Id: I9f6fe1ad19c78384ac5be7a4a147420aaf7363a5
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
The text was updated successfully, but these errors were encountered: