我现在在java里要调用别人给写好的dll
在网上搜了很多的方法 都有点懵。
我现在用的是这样的:
public static void main(String[] args)
{
//Test2 t=new Test2();
JNative jn=null;
String str="";
try {
jn=new JNative("C:/Program Files/Java/jdk1.6.0/bin/testDll.dll","MyCall");
jn.setRetVal(Type.STRING); 
            jn.setParameter(0,Type.STRING,"yf"); 
            jn.invoke(); 
            str = jn.getRetVal(); 
            System.out.println(str); } catch (NativeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
工程中添加了JNative.jar。都配置好了以后
运行的时候报了这样的错
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02e43f56, pid=616, tid=744
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b104 mixed mode, sharing)
# Problematic frame:
# C  [testDll.dll+0x3f56]
#
# An error report file with more information is saved as hs_err_pid616.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
不知道是怎么回事儿了  又说是jdk版本的问题(之前用得是jdk1.6的测试版 ,我又换了一个,结果还是不好用)
不知道是哪出问题了。
还希望谁有会的能指教一下。