title: Swapping a running jar at runtime
body: <p>I am building an update system in which I need to be able to replace a referenced jar of a running application jar at runtime. However, I am running into file locking issues on Windows when trying to perform file utility functions on the jar such as 'setLastModified'.</p>
  
  <p>After some googling I found this snippet...</p>
  
  <blockquote>
    <p>What I found in my research is that
    the standard ClassLoader
    implementation <em>never</em> closes a jar
    file once it has been opened. It also
    only loads resources from the jar file
    as needed. So at any particular time,
    there may be Classes in the jar file
    that have not been loaded into memory.
    Obviously, if you delete the jar file
    out from under the ClassLoader, and it
    tries to find a resource in the
    missing file, you're going to get an
    IOException at the very least.</p>
  </blockquote>
  
  <p>Does anyone have any references to information on doing this, or working around this issue?</p>
  
  <p>Thanks.</p>