0

I had an OpenJFX project in Eclipse which have severals Maven projects. I have a native library called EDSDK which is a library to interact with Canon Photo Cameras. This library have several DLLs and the JAR are all located in a directory called "libs" at the root of the project. In Eclipse there is no problems, the application run and find the library without problems. When i wanted to import this project in IntelliJ i faced two problems. First, how the paths are handled looked different. I had to change a bit the path to the configuration folder located at the root of the project aswell. The second problem i faced is that the native library wasn't found whatever i have done in IntelliJ (Linking inFile->Project Structure, etc.). It only worked when i copied the "libs" folder in the main app ".../target/classes" folder as as the error was saying ...

Exception in thread "cmd-dispatcher-0" java.lang.UnsatisfiedLinkError: Unable to load library '../libs/EDSDK_64/Dll/EDSDK.dll': Native library (win32-x86-64/../libs/EDSDK_64/Dll/EDSDK.dll) not found in resource path (C:\ws\PostePhotoTemp\poste-photo-ui\target\classes;C:\ws\PostePhotoTemp\poste-photo-modele\target\classes;C:\Users\xyz01.m2\repository\net\java\dev\jna\jna\4.5.2\jna-4.5.2.jar;... (long list of JAR files)

It first tried to look in the "target\classes" then in a long list of JAR files. What i am doing wrong ? I expected to have the same behavior in IntelliJ than Eclipse.

EDIT: I found out that if i put the "libs" folder one level outside the project, it work.

Thanks!

Rushino
  • 9,415
  • 16
  • 53
  • 93
  • Seems like your dll probably should be in the System32 folder: https://javarevisited.blogspot.com/2012/03/javalangunsatisfiedlinkerror-no-dll-in.html – ControlAltDel Feb 28 '20 at 21:47
  • What is the code loading the library? If it loads the library from resource path (classpath), then the library must be available there. Classpath in IntelliJ IDEA is what you have in the [module dependencies](https://www.jetbrains.com/help/idea/creating-and-managing-modules.html#working-with-module-dependencies) plus the target output paths. – CrazyCoder Feb 28 '20 at 21:51

0 Answers0