线程" main"中的例外情况java.lang.UnsatisfiedLinkError:无法加载指定的模块

时间:2017-03-05 12:35:28

标签: java tesseract

使用tessaract ocr时出现以下异常。这个例外背后的原因是什么?

Exception in thread "main" java.lang.UnsatisfiedLinkError: The specified module could not be found.

    at com.sun.jna.Native.open(Native Method)
    at com.sun.jna.Native.open(Native.java:1759)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
    at com.sun.jna.Library$Handler.<init>(Library.java:147)
    at com.sun.jna.Native.loadLibrary(Native.java:412)
    at com.sun.jna.Native.loadLibrary(Native.java:391)
    at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(Unknown Source)
    at net.sourceforge.tess4j.TessAPI.<clinit>(Unknown Source)
    at net.sourceforge.tess4j.Tesseract.init(Unknown Source)
    at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
    at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
    at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
    at tess4j.example.Ocreg.main(Ocreg.java:31)
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds)

1 个答案:

答案 0 :(得分:0)

Java代码希望在运行时使用本机库(这就是JNI的用途)。

您必须确保在正在查找的位置提供正确版本的库。请注意,这可能有点棘手,文档应该遵循文档。