Suppose I\'m embedding Sun\'s JVM in a C++ application. Through JNI I call a Java method (my own), which in turns calls a native method I implemented in a shared library. >
I am guessing your JVM will crash. Native C++ exceptions do not propagate into Java through JNI. One reason for that is that JNI is a C interface, and C knows nothing of C++ exceptions.
What you have to do is catch the C++ exceptions before you get into the C layer of your JNI code, and make the JNI C function return an error code. Then you can check for the error code inside Java and throw a Java exception if necessary.