raphw / byte-buddy

Runtime code generation for the Java virtual machine.
https://bytebuddy.net
Apache License 2.0
6.23k stars 804 forks source link

ByteBuddyAgent, Java 21 - A Java agent has been loaded dynamically #1639

Closed marlester-dev closed 4 months ago

marlester-dev commented 4 months ago

ByteBuddyAgent 1.14.15 ByteBuddyAgent.install() gives:

[13:56:53 ERROR]: [STDERR] [sun.instrument.InstrumentationImpl] WARNING: A Java agent has been loaded dynamically (C:\Users\Datenschutz :)\AppData\Local\Temp\byteBuddyAgent17729364774191930404.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

Though the programm works fine. Is it supposed to be so? Java 21, Windows.

raphw commented 4 months ago

You will have to set -XX:+EnableDynamicAgentLoading. This is VM limitation that a program cannot work around.

marlester-dev commented 4 months ago

Na good