Reputation: 1777
Is there any way to unload a DLL which gets loaded in the application using System.load() API call.
Upvotes: 4
Views: 5648
Reputation: 39733
You have to use a separate ClassLoader to load the dll. The dll is only bound to the ClassLoader it was loaded with. When the ClassLoader isn't used anymore (means no references to the ClassLoader exist), the garbage collector will free your ClassLoader and unload your dll.
Upvotes: 5