Why am i getting Unsatisfied Link Error?
The details are as follows:
Native Method’s prototype and its call in my java code is like this:
private native long sampleFunction(long[][] twoDimArray,
long number);
p.sampleFunction(twoDimArray, number);
Native method’s prototype in VC++ code is like this:
JNIEXPORT jlong JNICALL
Java_MyClass_sampleFunction(JNIEnv *env, jobject obj,
jobjectArray myArray,
long number);
Have you added the .dll you’re using to the Java library path by using the JVM startup parameter
-Djava.library.path=path/to/dll? If not, the JVM will not be able to link to the DLL and you will get the above error.You can also copy the .dll to the JVM lib directory if you prefer that method.