2

I have a project, let's call it Project A, that I am doing some computer vision things with. It is using the opencv-248.jar and the opencv_java248.dll. It is currently running on windows. When I run the tests for this project, the tests work fine and the opencv libraries are used fine.

I have another project, Project B, that is a web service running in Tomcat. This project uses Project A to perform the computer vision algorithms as a web service. For some reason, however, when running Project B, one of the classes in Project A is not able to load the opencv_java248.dll by calling System.loadLibrary(Core.NATIVE_LIBRARY_NAME). I have tested and found out that Core.NATIVE_LIBRARY_NAME evaluates to the correct name, but the System.loadLibrary call is failing.

Both projects use maven for dependency management, packaging, and deploying.

In the Project A jar, the opencv_java248.dll is in the root directory. I've searched through stackoverflow and maven and haven't found anything to load the library while running the tomcat service.

I'm also using Eclipse but I don't think that is the problem. I have tried deploying the war without Eclipse and I still had the same problem.

What do I need to do to get the dll loaded at runtime when Project B is running?

j will
  • 3,747
  • 11
  • 41
  • 64
  • If you are using `System.loadLibrary(nameOfTheLib)` it will use `java.library.path` system property for searching lib - in other case you need to provide full path. Please check [click](http://stackoverflow.com/questions/23189776/load-native-library-from-class-path) – baju Jan 27 '15 at 23:06

0 Answers0