/Library/Frameworks/test/Versions/A/test (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.11.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.1.0)
If i paste the .dylib file at location "/Library/Frameworks/test/Versions/A/test " from otool -L output.
and load the file through JNA , it works fine . But if i keep the dylib under resource folder , i get error .
java.io.IOException: Native library (darwin-x86-64/test.dylib) not found in resource path (/Users/username/Downloads/TestJNA/target/classes:
Even though i can see the dylib file present in /target/classes folder. Can someone suggest , how can i achieve calling dylib from resource folder ? I dont want to paste the dylib file at this location "/Library/Frameworks/test/Versions/A/test" .
This is how i am loading native library .
public class TestJNA {
public interface Perception extends Library {
Perception Instance = (Perception) Native.load("test", Perception.class);
void method1();
int method2(int a, int b, int c);
}
public static void main(String[] args) {
Perception.Instance.method1();
System.out.println(Perception.Instance.method2(1,2,3));
}
}