I am trying to unload a dll in java. I read this and this , but it seems that you cannot guarantee that the dll will actually be unloaded at a specific time. This is because System.gc () simply "kindly asks" to run the garbage collector.
So, here is the breakdown of the situation. I have a DLL that provides some functions through JNI. Lets call this dll MainDll. MainDll is loaded from a call to System.load ("MainDll"). I need to be able to upload and download this dll on the fly.
Is it possible to create another dll, the sole purpose of which is to load and unload MainDll. Lets call this DLL LoaderDll. Then I could just call System.load ("LoaderDll") and have some native functions for loading and unloading MainDll. The reason for this is because I have access to functions in my own system that can load and unload dlls on the fly. The tricky part of this is that I can still access my own functions that I wrote in MainDll if it is loaded from within LoaderDll.
Sorry if this is a confusing question. It seems a little hard to explain.
thank
source
share