[英]“Unable to load library: JNA native support not found in resource path” on trying to load JNA library on Mac OS X
I have a JNA library stub like this: 我有一个像这样的JNA库存根:
public interface FREngine extends Library {
NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance("FREngine");
FREngine INSTANCE = (FREngine) Native.loadLibrary("FREngine", FREngine.class);
}
If I try to use this library in any way, I get a really confusing error: 如果我尝试以任何方式使用此库,则会收到一个真正令人困惑的错误:
java.lang.UnsatisfiedLinkError: Unable to load library 'FREngine':
JNA native support (darwin/libFREngine.jnilib) not found in resource path
(...entire classpath here...)
Why this is confusing to me: 为什么这让我感到困惑:
DYLD_FRAMEWORK_PATH
? DYLD_FRAMEWORK_PATH
上DYLD_FRAMEWORK_PATH
吗? I tried looking at the frameworks themselves and can only see minor differences: 我尝试查看框架本身,只能看到微小的差异:
FREngine.framework
is in /Library
, CoreFoundation.framework
is in /System/Library
FREngine.framework
在/Library
, CoreFoundation.framework
在/System/Library
FREngine.framework/Versions
contains a directory with a longer and more complex name than CoreFoundation.framework
, which only has one version called A
. FREngine.framework/Versions
包含一个名称比CoreFoundation.framework
更长且更复杂的目录,该目录只有一个名为A
版本。 FREngine.framework/Versions/[ver]
contains Headers
and Libraries
FREngine.framework/Versions/[ver]
包含Headers
和Libraries
The version of JNA in use is 3.5.2. 使用的JNA版本是3.5.2。 We can't upgrade to 4.x because there is some other bug which causes an exception as soon as we try to load our native library.
我们无法升级到4.x,因为一旦尝试加载本机库,还有其他一些错误会导致异常。
The reason why FREngine library does not work in this case in a wrong Engine load method. 在这种情况下FREngine库在错误的Engine加载方法下不起作用的原因。 FREngine is expected to be loaded via com.abbyy.FREngine only.
FREngine只能通过com.abbyy.FREngine加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.