-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Based on trying to run Mockito with a simple example project on JDK 21 (EA build) result into the following WARNING:
[INFO] Running com.soebes.jdk21.AFinalClassTest
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
WARNING: A Java agent has been loaded dynamically (/Users/khm/.m2/repository/net/bytebuddy/byte-buddy-agent/1.14.5/byte-buddy-agent-1.14.5.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.793 s - in com.soebes.jdk21.AFinalClassTest
This is related to https://openjdk.org/jeps/451 of the OpenJDK.
Maven Version:
$ /home/khm/mockito-issue » mvn --version
Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /Users/khm/tools/maven
Java version: 21-ea, vendor: Oracle Corporation, runtime: /Users/khm/.sdkman/candidates/java/21.ea.26-open
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "13.4", arch: "aarch64", family: "mac"
JDK Version:
$ /home/khm/mockito-issue » java -version
openjdk version "21-ea" 2023-09-19
OpenJDK Runtime Environment (build 21-ea+26-2328)
OpenJDK 64-Bit Server VM (build 21-ea+26-2328, mixed mode, sharing)
Mockito Version: (via BOM): 5.3.1
I have overwritten the byte-buddy version with 1.14.5 (https://github.com/khmarbaise/mockito-issue/blob/main/pom.xml#L39) because otherwise JDK 21 failed completely with 1.14.4 wich is defined in mockito 5.3.1.
The questions which are coming up here:
- Is there an option to handle that at mockito level? I'm not sure?
- Or at byte-buddy level?
- Or should that being fixed on Configuration level of the maven plugin (surefire/failsafe)?
- Might the usage of
-XX:+EnableDynamicAgentLoading
be enough?
- Might the usage of
I've created a full working reproducer: https://github.com/khmarbaise/mockito-issue
remal, bmarwell, runeflobakk, nolequen, dbaltor and 40 more
Metadata
Metadata
Assignees
Labels
No labels