[英]Exception in thread “main” java.lang.UnsatisfiedLinkError: no opencv_java451 in java.library.path:
I'm trying to install OpenCV 4.5.2 on java.我正在尝试在 java 上安装 OpenCV 4.5.2。 I followed a video that had me download the jar and add that as a dependency with in my project structure for intellij.我观看了一段视频,该视频让我下载了 jar 并将其作为依赖项添加到我的 intellij 项目结构中。 The video told me to add a DLL for x64 on my native library locations.该视频告诉我在我的本地库位置上为 x64 添加 DLL。 I did that but I still keep getting this error.我这样做了,但我仍然不断收到此错误。
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java451 in java.library.path: A:\opencv\build\java\x64
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2447)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:809)
at java.base/java.lang.System.loadLibrary(System.java:1893)
at main.Main.<clinit>(Main.java:9)
One of the questions I read on stackoverflow asked about using.so file, but I can't find that and have no idea what they were talking about.我在 stackoverflow 上读到的一个问题是关于 using.so 文件,但我找不到,也不知道他们在说什么。 I'm also on windows 10 if that helps.如果有帮助,我也在 windows 10 上。
My code我的代码
package main;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Scalar;
public class Main {
static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
public static void main(String[] args) {
System.out.println("Welcome to OpenCV " + Core.VERSION);
}
}
I'm trying to install OpenCV 4.5.2 on java.我正在尝试在 java 上安装 OpenCV 4.5.2。 I followed a video that had me download the jar and add that as a dependency with in my project structure for intellij.我观看了一段视频,该视频让我下载了 jar 并将其作为依赖项添加到我的 intellij 项目结构中。 The video told me to add a DLL for x64 on my native library locations.该视频告诉我在我的本地库位置上为 x64 添加 DLL。 I did that but I still keep getting this error.我这样做了,但我仍然不断收到此错误。
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java451 in java.library.path: A:\opencv\build\java\x64
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2447)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:809)
at java.base/java.lang.System.loadLibrary(System.java:1893)
at main.Main.<clinit>(Main.java:9)
One of the questions I read on stackoverflow asked about using.so file, but I can't find that and have no idea what they were talking about.我在 stackoverflow 上读到的一个问题是关于 using.so 文件,但我找不到,也不知道他们在说什么。 I'm also on windows 10 if that helps.如果有帮助,我也在 windows 10 上。
My code我的代码
package main;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Scalar;
public class Main {
static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
public static void main(String[] args) {
System.out.println("Welcome to OpenCV " + Core.VERSION);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.