R
res7cxbi
How do you throw exceptions i defined myself in java from native code
(C++)?
(C++)?
How do you throw exceptions i defined myself in java from native
code (C++)?
the <init>()V method (which is the constructor, right?).From this output it tells me that it can find the class but can't find
And here's the revised C++ code:
//ExceptionExperimentImpl.cpp
JNIEXPORT void JNICALL Java_ExceptionExperiment_testException
(JNIEnv *env, jobject obj)
{
jclass cls = env->FindClass("MyException");
if (cls != NULL) {
env->ThrowNew(cls, NULL);
}
env->DeleteLocalRef(cls);
}
Actually, now i have another problem:
Really? The "A Utility Function" (6.1.2) at the URL
http://java.sun.com/docs/books/jni/html/exceptions.html#11202 does this
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.