Why does this code crash?
I have the following code
JavaVM*m_pJVM;/* denotes a Java VM */
JNIEnv*m_pEnv;/* pointer to native method interface */
JavaVMInitArgsm_VMArgs;
JavaVMOptionm_VMOptions;
m_VMOptions.optionString ="-Djava.class.path=.;D:\\Program Files\\Java\\jre1.5.0_06\\lib\\ext\\QTJava.zip;";
m_VMArgs.version = JNI_VERSION_1_4;
m_VMArgs.nOptions = 1;
m_VMArgs.options = &m_VMOptions;
m_VMArgs.ignoreUnrecognized =false;
/* load and initialize a Java VM, return a JNI interface
* pointer in env */
jint iRes = JNI_CreateJavaVM(&m_pJVM, (void**)&m_pEnv, &m_VMArgs);
if(iRes >= 0)
{
// invoke the Main.test method using the JNI
jclass cls = m_pEnv->FindClass("javaContainer");
// We are done.
m_pJVM->DestroyJavaVM();//Crash Here
}
If I comment you the FindClass call then it works fine. If I do not comment this out the DestroyJavaVM call exits the application.
FindClass always returns NULL, I need to find out why too. But for now I just want it to stop exiting on me.

