JNI - GetStringUTFChars
843829Dec 2 2003 — edited Dec 9 2003Hi,
I receive the same error message everytime my C program gets to the GetStringUTFChars statement.
Error = Hotspot virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
Can anyone explain what I'm doing incorrectly in this code?
JNIEXPORT jint JNICALL Java_com_ibm_expedite_expJavaInterface_expDB_ExpJni_jniOpenProject
(JNIEnv *env, jclass cls, jobject obj1, jobject obj2) {
char cap[128];
jfieldID fid = (*env) -> GetFieldID(env, cls, "projectName", "Ljava/lang/String;");
jstring jstr = (*env) -> GetObjectField(env, obj1, fid);
const char str = (env) -> GetStringUTFChars(env, jstr, 0);
strcpy(cap, str);
(*env) -> ReleaseStringUTFChars(env, jstr, str);
Thank you for the expertise!