【发布时间】:2011-08-03 02:47:58
【问题描述】:
我正在尝试使用 JNI 与第三方 DLL 集成。我编写了一个测试类来查看是否可以调用 DLL 中的方法,但我收到“UnsatisfiedLinkError”错误。
类如下所示:
public class MyTest {
native String ConfigureRequest(String a, String b, String c, String d);
static {
System.loadLibrary("my_dll");
}
@Test
public void quickTest(){
String result = this.ConfigureRequest("1", "1", "1", "NoControlBar");
System.out.println("Result: " + result );
}
}
我已经使用TypeLibrary Viewer 来调查 DLL,我可以看到该方法在那里(尽管它在包“EIAComInterface.TxnRequests”中说它,所以我想知道我是否需要在某处指定包方法)。我也可以验证方法参数是否正确。
谁能给点建议?
非常感谢, 齿轮。
【问题讨论】:
标签: dll com java-native-interface