title: How to automatically upgrade a Java application during its startup?
body: <p>I have a Java 1.6 application deployed on several machines (~ 30), and started as a Windows service.</p>
  
  <p>My main problem concerns the maintenance of these deployed artifacts: if I develop a new version of this application, I don't want to manually redeploy it on every machine.</p>
  
  <p>Ideally, when the Windows service is starting, it checks on a remote server if an update exists, and if it is found, then it upgrades the application.
  Note that it is acceptable that after this upgrade the service requires to be restarted again.</p>
  
  <p>This mechanism can be compared to the Maven snapshot verification: if there is a newer version of a <code>SNAPSHOT</code> version on a remote repository, then Maven download it before running it.
  Note that the application itself will be deployed on a Maven repository (in our case Nexus), so the check for an update will be done against this Nexus instance.</p>
  
  <p>What are my technical solutions to implement such an automatically application update?</p>
  
  <p>Do not hesitate to ask me more details about technical information or about the context...</p>
  
  <p>Thanks.</p>
  
  <hr/>
  
  <p><em>Edit</em>: As stated by Peter Lawrey, I can use Java Web Start. However, how can I integrate JWS within a Java application that is run as a Windows service? </p>