passing string array from java to C with JNI

You can write a simple function that takes a jobjectArray object, cast each one to jstring and then call GetStringUTFChars on it. Like this: void MyJNIFunction(JNIEnv *env, jobject object, jobjectArray stringArray) { int stringCount = env->GetArrayLength(stringArray); for (int i=0; i<stringCount; i++) { jstring string = (jstring) (env->GetObjectArrayElement(stringArray, i)); const char *rawString = env->GetStringUTFChars(string, 0); // … Read more

Eclipse reported “Failed to load JNI shared library” [duplicate]

First, ensure that your version of Eclipse and JDK match, either both 64-bit or both 32-bit (you can’t mix-and-match 32-bit with 64-bit). Second, the -vm argument in eclipse.ini should point to the java executable. See http://wiki.eclipse.org/Eclipse.ini for examples. If you’re unsure of what version (64-bit or 32-bit) of Eclipse you have installed, you can determine … Read more

tech