java使用JNI调用动态文件dll,报错,在线等!

jfashionjh 2018-02-01 02:35:50
函数名称:
JT_GetIDCardInfo(
HANDLE devNo,
char* Name,
char* Sex,
char* Nation,
char* Birth,
char* Address,
char* ID_Number,
char *IssueDepartment,
char* ValidingLife
);


java代码:
package test;

public class TestCard
{
// private native static String[] JT_GetIDCardInfo(char Name,
// char Sex,
// char Nation,
// char Birth,
// char Address,
// char ID_Number,
// char IssueDepartment,
// char ValidingLife);
// 首先定义指针,开辟内存空间,这里的内存空间根据返回的字符串来决定
private native static byte[] JT_GetIDCardInfo(byte[] Name,
byte[] Sex,
byte[] Nation,
byte[] Birth,
byte[] Address,
byte[] ID_Number,
byte[] IssueDepartment,
byte[] ValidingLife);

static {
System.loadLibrary("mcr03hid"); // 该动态库名称为中间动态库,由java程序使用,负责调用需要使用的动态库。

}

/**
* @param args
*/
public static void main(String[] args) {
System.out.println(JT_GetIDCardInfo(new byte[20],new byte[20],new byte[20],new byte[20],new byte[20],new byte[20],new byte[20],new byte[20]));
}
}
报错:
Exception in thread "main" java.lang.UnsatisfiedLinkError: test.TestCard.JT_GetIDCardInfo([B[B[B[B[B[B[B[B)[B
at test.TestCard.JT_GetIDCardInfo(Native Method)
at test.TestCard.main(TestCard.java:32)
...全文
236 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

10,606

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧