java.lang.UnsatisfiedLinkError
I'm using the hello-jni example, and for whatever reason, I'm getting a java.lang.UnsatisfiedLinkError when I try to call the hello-jni library. Any ideas why? Do I have to set my path somewhere?
in HelloJni.java:
public native String stringFromJNI();
and
static {
System.loadLibrary("hello-jni");
}
in hello-jni.c:
jstring
Java_com_bdunlay_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )
{
return (*env)->NewStringUTF(env, "Hello from JNI !");
}
the .so file is... project_root/libs/armeabi/libhello-jni.so
your native have no JNIEXPORT. It usually declares in header file with function declaration.
We will use javah -jni to generate the header
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With