title: Can I dynamically unload and reload (other versions of the same) JAR?
body: <p>I am writing a server program which is used to run unit tests of an API
  <i>(displaying lots of information and providing web access to control
  / monitor the whole thing)...</i></p>
  
  <p>This API is <strong>known to the server during compile time</strong> and is provided
  as a JAR.</p>
  
  <p>To be able to compare between unit test results of <strong>different versions</strong>
  of the API (without restarting the server),
  I want to be able to unload the 'current' version of the API,
  and to reload a newer one (or an older one).</p>
  
  <p>I don't want to use URLClassLoader and invoke every single
  method by name<br>
  ( using  <strong><code>getDeclaredMethod("someMethod")</code></strong> ),<br>
  because the server heavily depends on the API and it would be
  complicated to 'wrap' every method call in such dirty way.</p>
  
  <p>I was thinking: Since all interfaces of <strong>all</strong> versions of the JAR
  are <strong>same</strong>,  couldn't I do it by somehow reloading an other version
  of the JAR (without that by-name-invokation?).</p>
  
  <p><i>Note: I am using latest Java SE (6) and Java EE (5).</i></p>
  
  <p>If you think, what I'm trying to achieve is not possible,
  please suggest a 'workaround' or a different concept.</p>