2015-07-21 49 views
5

在RCP应用程序中使用System.loadLibrary方法加载dll文件时,只要我从Eclipse自身启动应用程序,它就会工作。但导出RCP应用程序并从出口代码启动时,我得到这个异常:在java中加载DLL文件

ERROR - Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help. Try using a 32 bit JRE also. 
java.lang.UnsatisfiedLinkError: D:\ExportTest\eclipse\plugins\<application_name>\ext\securityinterfaceX86\SecurityInterface-x86.dll: Can't find dependent libraries 

回答

6

您正在加载一个32位C++从64位JVM的二进制文件。您需要使用32位JVM或使用混合模式JVM。使用与Eclipse使用相同的JRE,你会没事的。

+0

我的系统有32位的JDK和JRE,并且在加载dll时检查“System.getProperty(”sun.arch.data.model“)”,它只返回32。 –