JNI异常:java.lang.UnsatisfiedLinkError-已解决

来源:互联网 发布:有什么好的淘宝会员名 编辑:程序博客网 时间:2024/04/29 06:21
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\windows_32bit\debug\JNI-UAPI.dll: 应用程序无法启动,因为应用程序的并行配置不正确。有关详细信息,请参阅应用程序事件日志,或使用命令行 sxstrace.exe 工具。
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1028)
 at com.csgrdb.ConnectManagement.ConnectManagement.<clinit>(ConnectManagement.java:7)
 at test.CSGRDB_Connect_JNI_TEST.CSGRDB_Connect_test(CSGRDB_Connect_JNI_TEST.java:39)
 at test.CSGRDB_Connect_JNI_TEST.main(CSGRDB_Connect_JNI_TEST.java:76)

在没有安装C++开发环境(vs2005/vs2008/vs2010)仅安装C++运行库(vcredist_x64/vcredist_x86)的情况下,程序中用到的C++动态库(*.dll)要使用realse版本,不要使用debug版本,使用debug版本就会出现 java.lang.UnsatisfiedLinkError。

注意:
在java通过JNI调用C++接口时:jdk位数(32bit/64bit)必须和C++动态库(*.dll)位数(32bit/64bit)必须一一对应:
jdk(32bit)--->C++动态库(*.dll)位数(32bit)
jdk(64bit)--->C++动态库(*.dll)位数(64bit)

1 0
原创粉丝点击