Library problems using Eclipse, OpenCV on Mavericks

asked 2014-03-13 12:39:42 -0600

Hello to everyone, I'm an italian noob and I'm trying to understand something about OpenCV , for my master thesis. I'm sorry for my english but I'll try to explain myself as good as possible. However, this is my problem:

I'm using a Macbook Pro with OS X 10.9.2. I downloaded the Tegra Android Development Pack here. After the installation I have Eclipse with OpenCV and I'm able to test OpenCV's samples on my Android phone. However, if I want to create a new project I have problems with Libraries. I googled a lot but I can't fix my problem. First of all I created a simple Java single-class project. The class is named "Start" and here is the code:

import org.opencv.core.Core;

import org.opencv.core.CvType; import org.opencv.core.Mat;

public class Start {

public static void main(String[] args){
    Mat mat = Mat.eye(3,3, CvType.CV_8UC1);
    System.out.println("mat = "+ mat.dump());


After that I "set up" the libraries: 1) open eclipse -> preferences -> Java -> Build path -> User Libraries 2) click "new" and type "OpenCV_2.4.5" 3) click "add external jars" 4) go to \sdk\java\bin\ and select my "opencv library 2.4.5.jar"

Then: 1) double clicked on my project and go to "properties" 2) go to "Java build path" 3) go to "Libraries" 4) go to "add Library" -> "user library" and select "OpenCV_2.4.5"

After these steps All the imports are ok and I don't have errors. However, when I run the application as "Java application", I have this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java245 in java.library.path
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at Start.main(

On the internet I found this error and people tell to set the "native library location" to something like opencv\build\java\x86. However I don't have nothing under opencv\build and honestly, I don't know whether the real problem is this one.

Thank you for the help

edit retag flag offensive close merge delete


no one can help me? Please

Fergu007 gravatar imageFergu007 ( 2014-03-15 04:41:02 -0600 )edit