I want to use OpenCV
code in maven project, the opencv-310.jar
created and run well.
following this page the way call local jar file, I install the jar
mvn install:install-file
-Dfile=/home/administrator/NetBeansProjects/OpenCV_Maven/opencv-310.jar
-DgroupId=localLibrary
-DartifactId=OpenCV -Dversion=3.1.0 -Dpackaging=jar
-DgeneratePom=true
and make POM
as below code
<dependencies>
<dependency>
<groupId>localLibrary</groupId>
<artifactId>OpenCV</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
Then run the Face detection application sample code. The exception, like below, occurred at the line calling Core.NATIVE_LIBRARY_NAME
, seems it failed to found jar.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path
I can't figure out how to fix, the same problem appeared when I practice the library with destop application, but can't solve it in same way.(add VM option-Djava.library.path
)
By the way, I don't use libopencv_java310.so
that was created with opencv-310.jar
at the same time. I am not sure is it necessary or not, if it have to be add to maven project, please tell me how to use it, I never used this kind of file.
Thanks for helps.