Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unload library (DLL) from the JVM

I need to unload a DLL that was loaded with System.loadLibrary(..), anyone know if this is possible?

like image 588
Alon Aizenberg Avatar asked Jan 17 '09 14:01

Alon Aizenberg


1 Answers

I don't have any experience of this, but a bit of digging shows that the library should be unloaded when the classloader which loaded the library is garbage collected.

Links:

  • Invocation API docs (Sun) - look for "Library and Version Management"
  • Java JNI DLL Unloading tutorial
like image 83
Jon Skeet Avatar answered Sep 28 '22 10:09

Jon Skeet