简体   繁体   中英

Netbeans IDE: java.lang.UnsatisfiedLinkError: OBIDISC4J.dll: Can't find dependent libraries

I am trying to execute a program related to UHF reader integration. The programming SDK (ID_ISC.SDK.Java-V4.7.0) has been given by the reader manufacturer (in my case, the reader is ID ISC.MRU102-USB reader by FEIG Electronic). When I tried running a sample project from this SDK, I got the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\OBID\OBIDISC4J.dll: Can't find dependent libraries
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
       at java.lang.Runtime.loadLibrary0(Runtime.java:870)
       at java.lang.System.loadLibrary(System.java:1122)
       at de.feig.FedmIscReader.<init>(Unknown Source)
       at ISOHostSample.ISOHostSample.<init>(ISOHostSample.java:41)
       at ISOHostSample.ISOHostSample.main(ISOHostSample.java:865)

I followed the instructions given in the readme file in SDK:

I have placed the required .dll files along with a .jar file (OBIDISC4J.jar) in OBID folder under Program Files and I have entered this path in Path environment variable.

The program is navigating to this path at runtime, but unable to pick up the jar library file from it, thus throwing the above exception.

Any help on resolving this would be greatly appreciated. Thank you

I've had some luck with the "depends.exe" Dependency Walker tool to learn specifically which dependent libraries it can't find. In the end it's usually because they're not on your classpath.

The DLLs need to be on your application's CLASSPATH, and that's not the same thing as the Path environment variable. Since the "src" folder is already on the classpath, what I usually do is create a "native\\windows" or "native/linux" folder inside "src" and put all my .DLL or .SO libraries in there.

If placing the libaries inside the project folder is not an option for some reason, you can specify the classpath on the command line to java.exe: "java -classpath -jar MyJar.jar"

I faced the same problem. My solution is copy all FEIG dlls to java bin path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM