adding openCV to java buildpath in eclipse

前端 未结 6 1116
滥情空心
滥情空心 2020-12-20 13:35

I have problems adding openCV to the buildpath of my eclipse-project. I have followed the instructions in the tutorial on this site: http://docs.opencv.org/2.4.4-beta/doc/tu

6条回答
  •  粉色の甜心
    2020-12-20 14:26

    The OpenCV java library is correctly linked to your Eclipse project.

    The problem is the OpenCV native library which is not in the java.library.path. The exception is thrown by the line

    static{ System.loadLibrary("opencv_java244"); }
    

    which link the java library to the native one.

    When you install OpenCV on your computer, it will also install a native dll library somewhere on your system, and when you call the System.loadLibrary, you tell java to search and load this library.

    Your current problem is Java can not find this library in your System, either because the library is not in one of the java.library.path folders, or because you have not OpenCV installed (also take a look at the version, maybe you have not the 2.4.4 because the last is 2.4.5, in which case you will have to adapt the String).

    I just noticed that your exception is about "opencv-java2.4.4". Be sure to have the right spelling of the form "opencv_java244", in your System.loadLibrary call.

    I also redirect you to one of my answer, which is related to JavaCV, but that explain in more details what is going under.

提交回复
热议问题