Ask Your Question
1

opencv-2.4.4 in java.library.path error

asked 2013-03-01 04:47:05 -0600

fferrieu gravatar image

updated 2013-03-02 01:44:04 -0600

Andrey Pavlenko gravatar image

following the tutorial and writing in eclipse

import org.opencv.core.CvType;
import org.opencv.core.Mat;
public class Main {
    public static void main(String[] args) {
      System.loadLibrary("opencv_java244");
          Mat m = Mat.eye(3, 3, CvType.CV_8UC1);
          System.out.println("m = " + m.dump());
    }
}

I get

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java244in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at Main.main(Main.java:9)

same problem with netbeans thought the libraries exist including the opencv native i.e libopencv.so

edit retag flag offensive close merge delete

Comments

make sure you use tha latest tutorial (updated on February 28) and the 2.4.4 release package (not beta that contained bugs).

Make sure you setup reference to the native lib folder correctly.

Also specify your OS for further suggestions.

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2013-03-02 01:47:46 -0600 )edit

My OS is ubuntu 13.04 ok I solved with the right LIB PATH and the sample program load right the opencv version but Mat m = Mat.eye(4, 4, CvType.CV_32F); lead to Unsupported major.minor version 51.0 why?

fferrieu gravatar imagefferrieu ( 2013-03-04 03:10:56 -0600 )edit
1

have you tried to set JAVA_HOME env var correctly?

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2013-03-04 04:51:17 -0600 )edit

problem solved thanks

fferrieu gravatar imagefferrieu ( 2013-03-04 05:02:21 -0600 )edit
1

@fferrieu I have the same problem, what did u do to solve this problem? I use eclipse to run the HelloCV tutorial and follow the latest tutorial. I just found that my error msg is a bit different, I got "java.lang.UnsatisfiedLinkError: no 2.4.4.0 in java.library.path" while @fferrieu got "no opencv_java244in java.library.path", i don't know why, I used the prebuilt opencv_244.jar, someone please help..

I just found that my error message is a bit different, i got "java.lang.UnsatisfiedLinkError: no 2.4.4.0 in java.library.path" whle @fferrieu got "opencv_java244" on his msg, I don't know why, someone please help..

galz_andz gravatar imagegalz_andz ( 2013-03-04 21:47:55 -0600 )edit

@fferrieu, I still with the same problem. My .jar files are in /build/bin and my native .so are in /build/lib. But even with this paths set correctly on eclipse, the problem persists; Wich was the correct JAVA_HOME that you say, and how did you set it?

Mateus M.L. gravatar imageMateus M.L. ( 2013-05-28 08:39:35 -0600 )edit

System.loadLibrary("opencv_java246") doesn't works ! please guide !

samchan gravatar imagesamchan ( 2013-09-14 23:18:47 -0600 )edit

3 answers

Sort by » oldest newest most voted
2

answered 2013-03-26 06:30:30 -0600

Thiago Salgado gravatar image

Hi , Andrey.

I don´t know if i´m right, but i had same problem and i resolved with:

In Library on Eclipse, i add opencv-244.jar , this erro happened, so , i click on edit and set Native library location: x86 inside /build/java.

For me this resolved this problem !

edit flag offensive delete link more

Comments

Hi Thiago, I met with this same problem as Andrey. Your advice is a solution of our problem.

Thank You :)

Dominik gravatar imageDominik ( 2013-04-03 16:46:45 -0600 )edit

http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html I followed the above tutorial. I do not have x86/build/java folder. Anybody, any clue plz

Tariq gravatar imageTariq ( 2014-12-02 02:34:50 -0600 )edit
1

answered 2013-08-13 12:45:35 -0600

J-S gravatar image

I had this same problem. Try if you use corresponding OpenCV version. It must be equal to opencv_java244. If you are using 2.4.6 try with 'opencv_java246' etc ;)

Hope this helps Jan

edit flag offensive delete link more

Comments

This really did solve my problem, probably something we wouldn't really notice. Good catch

Vivek_Elango gravatar imageVivek_Elango ( 2016-01-21 08:44:51 -0600 )edit
0

answered 2013-07-15 07:39:11 -0600

jiting gravatar image

for ubuntu 13.04, the .so file locate under build/lib.

That works for me.

Thanks

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-01 04:47:05 -0600

Seen: 28,970 times

Last updated: Sep 22 '13