title: Can you unload and then reload a different version of the same JAR, which is a dependency of a second JAR, without reloading the second JAR?
body: <p>I have a series of folders that contain JAR files, these JARs act as plugins for my main application. Each seperate folder of JARs is loaded with its own classloader, so that that folder of JARs can be loaded and unloaded independantly of other folders. </p>
  
  <p>Some JARs have dependencies on other JARS. In several cases there are multiple JARs (Say, <em>Set A</em>) that have a dependency on the same seperate JAR (Lets call it <em>BaseJar</em>). For this reason I have a seperate folder for this <em>BaseJar</em>, so that I can just load it the once and not have multiple places where the JAR could exist.</p>
  
  <p>I need to provide the functionality where any one of these sets of JARs could be disabled, and then reloaded. So that any small updates to these plugins can be done on the fly without having to disable the entire application. This leads me to the question in my title. If I were to unload this <em>BaseJar</em> class, so that it could be updated, is there a way to avoid then having to unload and reload <strong>all</strong> of the <em>SetA</em> JARs as well? I would like them to be able to continue to operate as normal as soon as their new dependency has been loaded by the seperate class loader.</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: To clarify my position, after some answers have been given, I already have a working custom JarClassLoader. At present I can load up all of my plugins and unload them all just fine. I need to know whether it's possible for me to load and unload in batches, without affecting other JARs that may use some class contained in another JAR which gets upgraded at runtime.</p>
  
  <p>I'm aware there may be issues if I attempted to use that plugin <strong>during</strong> the upgrade process, where the class it's attempting to use is no longer loaded by the JVM and therefore unavailable until the newer version has been loaded. It's just <strong>after</strong> this new class has been uploaded, will it possibly lead resolution problems?</p>