Ask Your Question
3

no opencv_java244 in java.library.path

asked 2013-02-23 04:52:04 -0600

goodspeed gravatar image

Hi i try use OpenCV like in "introduction in java development", but i dont know what i must edit in image description. When i change my folder with extracted OpenCV, Eclipse write no opencv_java244 in java.library.path. What i do wrong?

edit retag flag offensive close merge delete

Comments

Same problem here..i done everything the vm options in my netbeans project then i get a new error saying : cant find dependent libraries..can anyone help me..Thanks

Salamatah gravatar imageSalamatah ( 2018-02-28 04:26:05 -0600 )edit

Don't post a question as an answer. Don't hope any answer : this post is too old. Post your question as a new one. gives opencv version and platform and full error message

LBerger gravatar imageLBerger ( 2018-02-28 04:29:31 -0600 )edit

"cant find dependent libraries" -- make sure, your opencv dlls are on the PATH env var

berak gravatar imageberak ( 2018-02-28 04:30:23 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
6

answered 2013-02-23 13:20:16 -0600

Dangthrimble gravatar image

After much trial and error(!), assuming OpenCV is installed on a Windows machine at <opencv-dir>:

  • The JAR is in <opencv-dir>\build\java.
  • On a 32-bit Windows machine, the Native Library Location is <opencv-dir>\build\java\x86.
  • On a 64-bit Windows machine, the Native Library Location is <opencv-dir>\build\java\x64.

Therefore, on my 64-bit Windows 7 PC with OpenCV installed at D:\opencv:

  • The JAR is in D:\opencv\build\java.
  • The Native Library Location is D:\opencv\build\java\x64.
edit flag offensive delete link more

Comments

it works for me with native library located in D:\opencv\build\java\x32. Thanks!

goodspeed gravatar imagegoodspeed ( 2013-02-24 05:32:11 -0600 )edit

thanks a lot! :D

sharpsh007er gravatar imagesharpsh007er ( 2013-03-12 06:21:24 -0600 )edit

Thanks. This works !!!

Tharindu Rusira gravatar imageTharindu Rusira ( 2013-06-12 10:43:12 -0600 )edit
3

answered 2014-02-02 03:24:48 -0600

Flynn gravatar image

updated 2014-02-02 03:30:28 -0600

Answer for mac users:

It seems no one has posted the location of the OpenCV Java native directory/files for mac users!

After a great deal of searching, I finally found it:

On Mac OSX Mavericks, having done a Cmake build of 2.4.8, I found that setting the "Native Library Location" to the directory "build/lib" did the trick!

It seems that "build/lib" contains a file named "libopencv_java248.dylib", which is apparently exactly what the Mac version of OpenCV wants as its native file!

As an example, for my project, the full location was:

/Users/Flynn/Documents/Eclipse Main Workspace/_Libraries/opencv-2.4.8/build/lib

Where "opencv-2.4.8" was the copy of 2.4.8 that I downloaded, and where "/build" is the build folder that I was instructed to make by this tutorial.

Hope this helps any fellow mac users!

edit flag offensive delete link more

Comments

I have been dealing with this same issue. I pointed my Native Library to the build/lib folder, but I still am getting compile time errors:

System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

NATIVE_LIBRARY_NAME cannot be resolved or is not a field

kommi10 gravatar imagekommi10 ( 2014-03-23 23:46:10 -0600 )edit
1

answered 2013-02-23 06:09:05 -0600

Java API is only wrapper for native C++ library. Your java machine must find it in run time. Specify path to the native OpenCV libraries in project settings: select project, right click->properties, "java build path", "libraries" tab, select the OpenCV jar, expand it, select "Native library location", click "edit...", folder chooser dialog will appear.

edit flag offensive delete link more

Comments

So, for a 64-bit Windows machine, that would be ...\opencv\build\x64\mingw\bin or ...\opencv\build\x64\mingw\lib?

Dangthrimble gravatar imageDangthrimble ( 2013-02-23 11:51:09 -0600 )edit

Have tried D:\opencv\build\x64\mingw\bin, D:\opencv\build\x64\mingw\lib and D:\opencv\build\x64\mingw and I still get the same "no opencv_java244 in java.library.path" error as goodspeed. A bit more information would be a real help. What identifies the native library's location?

Dangthrimble gravatar imageDangthrimble ( 2013-02-23 12:21:29 -0600 )edit

D:\opencv\build\java\x64

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2013-02-25 02:52:34 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-02-23 04:52:04 -0600

Seen: 28,167 times

Last updated: Feb 28 '18