 <p>please try closing the classloader before you 'unload' it.</p> <pre><code>public void unloadJarAndClass() throws IOException { dukeClassLoader.close(); /* all object must be collected in order to reload jar */ jarFile = null; dukeClassLoader = null; classToLoad = null; // System.gc(); don't do this unless you're really // sure you have to ! } </code></pre> <p>I would recommend not calling System.gc() explicitly ! (see <a href="http://stackoverflow.com/questions/2414105/why-is-it-bad-practice-to-call-system-gc">Why is it bad practice to call System.gc()?</a> for example)</p>