Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unload The JVM.dll from native code

843829Oct 15 2003 — edited Nov 20 2003
Hi,

I am working on Windows XP, using sdk142.

My code does sth like this:
  // load the library via Windows API
  LoadLibrary("jvm");
 
 
  // get some proc addresses
  GetProcAddress(...);
 
 
  // create the Java VM via JNI
  JNI_CreateJavaVM(...);
 
 
  /*
   * do some calls to the JNI via JNIEnv
   */
 
 
  // after all destroy the VM
  DestroyJavaVM(...);
 
 
  // unload the dll via Windows API
  FreeLibrary(...);
This works fine, but the jvm.dll is never unloaded ! If I call FreeLibrary() just after getting the proc addresses, the unload succeeds, but a call of FreeLibrary() after the JNI_CreateJavaVM doesn`t work .

How can I solve the problem ?

kind regards

Adrian Ofterdinger
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2003
Added on Oct 15 2003
8 comments
987 views