In an application I'm developing, we need to invoke "Plugins", these plugins are installed outside of the scope of the application's CLASSPATH. I'm currently using the URLClassLoader in order to instantiate the main class of each plugin. However, the problem with this is that while I've tried to remove any reference to the URLClassLoader when I'm done with a plugin, the JAR file used by the late URLClassLoader is still locked! Only when I completely exit my JVM the file gets released.
My question is: Should I write my OWN ClassLoader that will release the JAR files after first caching their contents, or is there a way to FORCE/HINT the JVM to release these JAR files?
Thanks in advance,