Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading DLL file in java

Tags:

java

While loading a dll file, using System.loadLibrary method, in a RCP application, it's working as long as I am launching the application from Eclipse itself. But when exporting the RCP application and launching from the exported code, I am getting this exception :

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
like image 513
subrat patra Avatar asked Jul 21 '15 10:07

subrat patra


1 Answers

You are loading a 32bit C++ binary from a 64 bit JVM. You need to either use a 32 bit JVM or go for a mixed mode JVM. Use the same JRE that your Eclipse uses and you will be fine.

like image 97
Geek Avatar answered Oct 03 '22 06:10

Geek