Exceptions and javac
Hi,
I have 2 problems with my JNI code:
1 - I created MyException class in Java. And my native method throws this using:
jclass JExpClass = env->FindClass("package/MyException");
if (JExpClass != NULL)
env->ThrowNew (JExpClass, "Example Exception");
env->DeleteLocalRef (JExpClass);
The exception is thrown fine. But the problem comes in catching it:
catch (Exception) //This work OK!
catch (package.MyException) //Exception is not caught!
The class path is fine. Explanations?
2 - The same scenario above. Since MyException extends from Exception, I would expect it to be checked for during compile time. However when I remove the the try and catch clause around the Java code calling the native method, javac does not complain when it should.
What's wrong here?
Thanks.
Dhruv

