Re: Can't find my own exception class via JNI



Gordon Beaton <not@xxxxxxxxx> wrote:

> Where is the class, and what does your classpath contain?

It's in the same place (package and jar) as the class that
contains the native methods.


> Correct me if I'm wrong, but your findClassOrDie() doesn't appear to
> actually return the jclass it is declared to return.

It was a mistake in my transcription to Usenet. The function
should have been (and actually is):

jclass findClassOrDie( JNIEnv *env, char const *name ) {
jclass const theClass = env->FindClass( name );
if ( !theClass ) {
cerr << "FindClass(" << name << ") failed" << endl;
exit( 1 );
}
return theClass;
}

- Paul
.