开发者

JNI System.LoadLibrary failed on Cocoa dylib

开发者 https://www.devze.com 2023-03-11 06:22 出处:网络
following JNI guidelines, I created a dylib (in Objective-C) using Xcode and expected to load it in my Java project, like the following does,

following JNI guidelines, I created a dylib (in Objective-C) using Xcode and expected to load it in my Java project, like the following does,

public class Main {
private native void done();
    public static void main(String[] args) {
        New Main().done();
}

static {
    System.loadLibrary("Test");
}

public Main() {
    super();
}

and I am getting the following runtime error -

Exception in thread "main" java.lang.UnsatisfiedLinkError: no Test in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1754)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045开发者_高级运维)
at Main.<clinit>(Main.java:27)

How could I get this fixed?


Tried using the System.load with full path to the library and it worked.

0

精彩评论

暂无评论...
验证码 换一张
取 消