0

I am running Mint 17.1 (Rebecca) KDE (64-bit).

I installed opencv 2.4.8, from the repository, with the python bindings (and I am currently working with opencv-python).

I cannot run a simple example OpenCV program in Java, using an IDE. I tried Eclipse, NetBeans and Intellij IDEA.

I add the following library to the project:

/usr/share/OpenCV/java/opencv-248.jar

When I try to run a simple example source code, I got the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java248 in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)

at java.lang.Runtime.loadLibrary0(Runtime.java:870)

at java.lang.System.loadLibrary(System.java:1122)

at Hello.main(Hello.java:7)

From the error, there is some problem with the java.library.path. Actually, I saw in some posts (all for windows users) where they do something like (step 5 - source):

Change VM options to add native library "-Djava.library.path="C:\opencv\build\java\x86""

But I am not sure how to implement this step in my system. For example, in Eclipse I added the following path: /usr/lib/x86_64-linux-gnu/

The reason for the above path was that I found that some of the libraries of opencv are there:

$locate opencv_core

/usr/lib/x86_64-linux-gnu/libopencv_core.a
/usr/lib/x86_64-linux-gnu/libopencv_core.so
...

Thank you.

Community
  • 1
  • 1
dvsaraiva
  • 491
  • 1
  • 6
  • 13
  • 1
    note, that there's 2 ways of loading the native so: 1.) System.loadLibrary(so_name); - which depends on java.library.path, 2.) System.load("/complete/path/to/opencv_java-XXX.so"); - which does not. – berak May 16 '15 at 20:15

1 Answers1

0
solition :
 ==>Right click on the Project
 ==>Properties
 ==>Click on RUN
 ==>VM Options : -Djava.library.path="C:\Your Directory where Dll is present"
 ==>Ok
mesutpiskin
  • 1,771
  • 2
  • 26
  • 30