I work with JNI and try to unload (destroy) the virtual machine using the DestoryJavaVM function (first I call the DetachCurrentThread method). It looks like this is now affecting the virtual machine, and it still remains after the call. I read in old Sun posts that DestoryJavaVM had problems in the past (JDK1.1-1.3 in 2001), but I'm using JRE 6, and it probably should work now, right? I need to load \ Unload a virtual machine into the same life process, since each boot requires different classes to boot. Any ideas how to do this?
Additional Information:
At the unloading stage, I can successfully disconnect CurrentThread and destroyVM (both return JNI_OK). I even FreeLibray (jvm.dll) successfully (return 1). When I try to load the JVM again, I can load LoadLibrary () and then find the CreateVM function in the DLL, and the CreateVM call will fail (return -1). What am I doing wrong here?
Thanks Guy
source share