简体   繁体   English

线程“主”java.lang.UnsatisfiedLinkError 中的异常:java.library.path 中没有 opencv_java451:

[英]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.

相关问题 线程“ main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有opencv_java2410 - Exception in thread “main” java.lang.UnsatisfiedLinkError: no opencv_java2410 in java.library.path 线程“main”中的异常 java.lang.UnsatisfiedLinkError:java.library.path 中没有 opencv_java249 - Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java249 in java.library.path 线程“ main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有libz3java - Exception in thread “main” java.lang.UnsatisfiedLinkError: no libz3java in java.library.path 线程“ main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有libopencv_java247 - Exception in thread “main” java.lang.UnsatisfiedLinkError: no libopencv_java247 in java.library.path 线程“ main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有indri_jni - Exception in thread “main” java.lang.UnsatisfiedLinkError: no indri_jni in java.library.path 线程“main”中的异常 java.lang.UnsatisfiedLinkError:java.library.path 中没有 lpsolve55j - Exception in thread “main” java.lang.UnsatisfiedLinkError: no lpsolve55j in java.library.path 线程“ main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有终端 - Exception in thread “main” java.lang.UnsatisfiedLinkError: no Terminal in java.library.path 线程“main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有jpcap - Exception in thread “main” java.lang.UnsatisfiedLinkError: no jpcap in java.library.path 线程“ main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有swt-pi-gtk-3139 - Exception in thread “main” java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3139 in java.library.path 线程“main”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有lwjgl - Exception in thread “main” java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM