Java JNI error java.lang.UnsatisfiedLinkError:

java -Djava.library.path=. TestJNI
>>>>

Exception in thread "main" java.lang.UnsatisfiedLinkError: TestJNI.calibrate([D[DII)[D
 at TestJNI.calibrate(Native Method)
 at TestJNI.main(TestJNI.java:61)

I know that the library is loading, otherwise the error indicates the impossibility of calibrating the library. What does the above error mean?

EDIT

this is my implementation -

JNIEXPORT jdoubleArray JNICALL Java_TestJNI_cailbrate (JNIEnv * env, jobject jobj, jdoubleArray rtt, jdoubleArray distance ,jint activecount,jint passivecount) {
jdoubleArray jresult = (*env)->NewDoubleArray(env,3);
 .......
return jresult;
}

Are the parameters correct?

+5
source share
2 answers

This message means that Java is looking for its own method, which is similar to the Java method

double[] calibrate(double[], double[], int, int)

If you generated the header files correctly and built the library, this most likely means that you are missing an implementation of this method.

Some things that come to mind:

  • Did you restore the library after you implemented this method?
  • Did you manage to change the Java method interface after creating the library?
+7
source

<jni.h>. , x86, includes x64.

+1

All Articles