日期:2014-05-20  浏览次数:20636 次

java调用第三方dll出错,求帮助。。
dll是对ic卡操作的,delphi写的,里面的一个函数
function icmake(port:integer;userid:string;userpw:string;price:real;):integer;
我用jnative调用它
System.loadLibrary("makecard");
JNative jn = new JNative("makecard","icmake");
jn.setRetVal(Type.INT);
jn.setParameter(0, Type.INT, "2");
jn.setParameter(1, Type.STRING, "user");
jn.setParameter(2, Type.STRING, "password");
jn.setParameter(3, Type.FLOAT, "0");
jn.invoke();
System.out.println(jn.getRetVal());
出现下面大情况,请问这是怎么回事呢?
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0b0029b1, pid=3516, tid=5396
#
# Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86)
# Problematic frame:
# C  [makecard.dll+0x29b1]
#
# An error report file with more information is saved as:
# C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\dlltest\hs_err_pid3516.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
------解决方案--------------------
C:\Documents and Settings\Administrator\Workspaces\MyEclipse 8.5\dlltest\hs_err_pid3516.log

这里面看看什么错。

另外建议用JNA,这个相对更简单