gpt4 book ai didi

java - JMVTI :Could not find agent library

转载 作者:行者123 更新时间:2023-12-01 18:11:32 26 4
gpt4 key购买 nike

我为 Java 编写了一个代理,它什么也不做,只是导出两个方法,只是为了检查它是否在 JVM 启动时加载。使用 mingw-w64 4.8.4(使用 JetBrains CLion)构建它。 Windows 7 x64。

JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved){
return JNI_OK;
}

JNIEXPORT void JNICALL
Agent_OnUnload(JavaVM *vm){}

运行时出错

java -agentlib:"C:\JMVAgent\agent.dll"

Error occurred during initialization of VM
Could not find agent library libSampleAgent.dll on the library path,
with error: Can't find dependent libraries

此外,我将 agent.dll 放入 c:\windows\System32 并运行 java w/o agent 完整路径,得到相同的结果。

DependencyWalker 显示没有依赖错误 enter image description here

请帮忙找出我做错了什么

最佳答案

如果您要指定代理库的完整路径,请使用 -agentpath 而不是 -agentlib

差异解释here .

关于java - JMVTI :Could not find agent library,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32605996/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com