出现动态代理警告:WARNING: A Java agent has been loaded dynamically (E:\Wexxxx)的解决方案

出现这个警告是不会影响运行成功的,只是警告而已,程序运行不了这个警告不背锅,问题解决方案是点击修改运行配置:

然后修改下半部分的第二行为:

-ea -XX:+EnableDynamicAgentLoading -Xshare:off

并且只能在运行栏进行重新运行才行:

还有一个解决方案,让这个警告不会再出现,就是将JDK版本降低,11就差不多

> Task :compileJava UP-TO-DATE > Task :processResources UP-TO-DATE > Task :classes UP-TO-DATE > Task :compileTestJava > Task :processTestResources NO-SOURCE > Task :testClasses > Task :test . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v3.4.3) 2025-03-13T14:43:45.701+08:00 INFO 28364 --- [demo] [ Test worker] annotation.DemoApplicationTests : Starting DemoApplicationTests using Java 23.0.2 with PID 28364 (started by lxh's computer in D:\code\demo) 2025-03-13T14:43:45.704+08:00 INFO 28364 --- [demo] [ Test worker] annotation.DemoApplicationTests : No active profile set, falling back to 1 default profile: "default" 2025-03-13T14:43:45.898+08:00 INFO 28364 --- [demo] [ Test worker] annotation.DemoApplicationTests : Started DemoApplicationTests in 0.56 seconds (process running for 1.894) Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build what is described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#0.3 WARNING: A Java agent has been loaded dynamically (C:\Users\lxh's computer\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy-agent\1.15.11\a38b16385e867f59a641330f0362ebe742788ed8\byte-buddy-agent-1.15.11.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 OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended > Task :test BUILD SUCCESSFUL in 4s 4 actionable tasks: 2 executed, 2 up-to-date 14:43:47: 执行完成 ':test --tests "annotation.DemoApplicationTests"'。
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值