JNI - exception.toString()

Blog: June 17th, 2008

Sometimes JNI works. And then it fails.
I am still working on one of the bugs but I found a code to print out the exception (ex.toString() equivalent) in c:

if (env->ExceptionCheck()) {
jthrowable e = env->ExceptionOccurred();

char buf[1024]; memset(buf, 0, 1024);

// have to clear the exception before JNI will work [...]