I have just upgraded from JDK 17 to 21 in my Windows machine. After that when I am running JUNIT test and I am getting the following warring. I have looked over all of the day, but no solution worked for me. Any feedback please:
WARNING: A Java agent has been loaded dynamically (...\byte-buddy-agent-1.14.9.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
-XX:+EnableDynamicAgentLoading
when executing your tests, though all that will do is hide the warning, and might eventually stop working in a future release. – Erkan-javaagent
) instead of as a library (i.e., via--class-path
or--module-path
). However, it appears that neither IDEs nor build tools make this particularly easy, so properly fixing the problem will likely have to wait until IDEs and build tools "catch up". That said, I believe the GItHub issue has a comment somewhere that shows a solution/workaround for Maven (which you appear to be using). – Erkan