0

I'm trying to run openCV library on a java web project using eclipse, and the steps I followed are shown in this link : http://docs.opencv.org/doc/tutorials/introduction/desktop_java/java_dev_intro.html#java-dev-intro

The problem is, in the web project we have to put the .jar files in the WEB-INF/bin folder, so in my case its a user library not a jar file, and when I compile the code it throws the following exception:

java.lang.UnsatisfiedLinkError: no opencv_java246 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)

Can you help me importing the native library in other way ?

Thanks

4

2 回答 2

0

在 Web 应用程序中,您的“*.jar”应该在 lib 文件夹中。因为内部服务器只能识别 lib 文件夹中的 .jar 文件。文件夹结构:

  rootfolder
        *.jsp

        WEB-INF
            classes
            lib
              *.jar

表示 WEB-INF/lib/*.jar

然后它编译得很好。

于 2013-08-04T06:37:53.320 回答
0

在服务器中运行项目之前,您必须在服务器的VM 参数中添加-Djava.library.path

要添加-Djava.library.path,请按照路径

项目->运行方式->运行配置

在那之后,

选择Arguments选项卡并在VM arguments文本区域中添加以下属性

-Djava.library.path="OpenCV/OpenCV 2.4.11/opencv/build/java/x64"

检查另一个可能重复的stackoverflow线程

于 2015-12-08T13:04:01.970 回答