Possible Duplicate:
how to use .dll files in java code?
The dll file, I am using, is giving error:
The error message is:
java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: Eagleye_parser
at java.lang.Runtime.load0(Runtime.java:767)
at java.lang.System.load(System.java:1005)
at test.TestDllJava.<clinit>(TestDllJava.java:15)
Exception in thread "main"
This is the code:
public class TestDllJava {
private static native String[] eagleye_fmu(String A);
public static void main(String[] args){
String[] ag = null;
String parameter = null;
parameter = "356188030442449 10250000 0001F464 0000EB34 0002CC7D 4xA0";
ag = eagleye_fmu(parameter);
System.out.println(ag);
}
static {
System.load("Eagleye_parser");
}
}
Please correct me, where I am doing wrong.
As the docs of load() specify:
A better approach without stating an absolute path to library is by using loadLibrary() or maybe
load(
mapLibraryName(..)
)
.In Eclipse, you can specify native library folder in your project via project Properties -> Java build Path -> tab Libraries -> expand your System Library, click Native Library Location. Eclipse will build
java.library.path
for you andloadLibrary()
will then see it easily.