2 Replies Latest reply: May 2, 2010 9:25 PM by 843804 RSS

    Changing a jar file while the jvm is running

    843804
      I have a situation. Let me describe it below:

      I have swing application, everytime it starts it interacts with a web server and downloads any updates. These updates are downloaded as a zip file. This zip file contains many jar files and property files. The swing application next unnzips this file and stores the jar file and the properties file in its own installation folder, essentially wiping out the jar file from which it was started.
      It then updates some database tables and then tell the user to restart the application.

      The question I have is, is this correct? Replacing a jar file when the jvm has been started. I dont understand the way classes are loaded, but if I replaces the jar files, will it result in some spurious behaviour?
        • 1. Re: Changing a jar file while the jvm is running
          793415
          Sethu.R wrote:
          I have a situation. Let me describe it below:
          ..then tell the user to restart the application.
          All that can be achieved using [Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp], and done more easily. JWS offers automatic updates, as well as a host of other features like desktop integration, sand-boxed access to the local file system/printer/persistence..
          • 2. Re: Changing a jar file while the jvm is running
            843804
            I was having a quick look at JWS. I am not sure if it would work in the case that I have. I first make the swing application log on to the web server. This creates a session on the web server. Only then do I allow the swing app to download the latest update. The update is a value added service and the user will be charged a fee for the same.