我希望制作一个依赖于maven文件
简化代码如下:
它适用于以下警告(针对Java 9):
在Maven依赖文件夹中折叠opencv jar文件可以看到所有库都是灰色的,如下图所示: 如果我忽略了这个警告并未使用警告信息中提到的命令链接库,会发生什么? 因为使用Java让opencv更易携带很简单,我想知道是否有问题,以便在将来继续使用此方法。 我正在使用JDK 9、Eclipse Oxygen.2和Fedora 27。 将来,应用程序的目标可能是Windows。
pom.xml
的可移植的opencv
应用程序。简化代码如下:
import org.opencv.core.Mat;
public class Builder {
public static void main(String[] args) {
nu.pattern.OpenCV.loadShared();
System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
Mat mat = new Mat(4,3,1);
System.out.println(mat.dump());
}
}
我将这个添加到pom.xml
文件中:
<dependency>
<groupId>org.openpnp</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-0</version>
<scope>compile</scope>
</dependency>
它适用于以下警告(针对Java 9):
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by nu.pattern.OpenCV$SharedLoader (file:/home/martin/.m2/repository/org/openpnp/opencv/3.2.0-0/opencv-3.2.0-0.jar) to field java.lang.ClassLoader.usr_paths
WARNING: Please consider reporting this to the maintainers of nu.pattern.OpenCV$SharedLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/opencv_openpnp6598848942071423284/nu/pattern/opencv/linux/x86_64/libopencv_java320.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
101, 115, 47;
108, 105, 98;
47, 108, 105;
98, 111, 112]
更新:并且针对Java 8的以下警告:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library/tmp/opencv_openpnp3835511967220002519/nu/pattern/opencv/linux/x86_64/libopencv_java320.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
在Maven依赖文件夹中折叠opencv jar文件可以看到所有库都是灰色的,如下图所示: 如果我忽略了这个警告并未使用警告信息中提到的命令链接库,会发生什么? 因为使用Java让opencv更易携带很简单,我想知道是否有问题,以便在将来继续使用此方法。 我正在使用JDK 9、Eclipse Oxygen.2和Fedora 27。 将来,应用程序的目标可能是Windows。