5 Java_throwit_throwit (JNIEnv
*env
, jclass klass
, jstring name
,
8 const char *buf
= (*env
)->GetStringUTFChars (env
, name
, NULL
);
9 jclass k
= (*env
)->FindClass (env
, buf
);
10 (*env
)->ReleaseStringUTFChars (env
, name
, buf
);
12 if (k
== NULL
|| (*env
)->ExceptionCheck (env
))
16 (*env
)->ThrowNew (env
, k
, "the word is zardoz");
19 jmethodID id
= (*env
)->GetMethodID (env
, k
, "<init>",
20 "(Ljava.lang.String;)V");
21 jstring z
= (*env
)->NewStringUTF (env
, "zardoz is the word");
22 jobject obj
= (*env
)->NewObject (env
, k
, id
, z
);
23 (*env
)->Throw (env
, obj
);