0

Possible Duplicate:
How can I write a Java application that can update itself at runtime?

Hello guys, I want to be able to run a live update on my application.. So when there is an update, it notifies the user and then when allowed it downloads the necessary files and not the whole application again. I just need a detailed breakdown on what I need to do to achieve this.

Community
  • 1
  • 1
DaMainBoss
  • 2,035
  • 1
  • 19
  • 26
  • 1
    Sounds like you want to use Java web start. http://download.oracle.com/javase/tutorial/deployment/webstart/ – Kaj May 19 '11 at 19:00
  • Live, as in update without restarting the application? – aioobe May 19 '11 at 19:01
  • yes during runtime...just like every app updates and then maybe restarts or something... – DaMainBoss May 19 '11 at 19:04
  • We have no idea how to answer this question without knowing the specifics of your app. There are hundreds of different ways to implement app updating. Google has an interesting article on what they've done to update chrome http://blog.chromium.org/2009/07/smaller-is-faster-and-safer-too.html If it's not that helpful, it's at least interesting. – Falmarri May 19 '11 at 19:06
  • 1
    "I just need a detailed breakdown on what I need to do to achieve this." - I like how you juxtapose the word 'just' right next to a request for extensive information. – jjnguy May 19 '11 at 19:07
  • Thanks Falmarri would take a look at it – DaMainBoss May 19 '11 at 20:01
  • Peter it looks like I should read the options there but anyone seeing the last answer here? Something about Rebel! – DaMainBoss May 19 '11 at 20:02

3 Answers3

1

Consider to build your application on top of the NetBeans Platform (a Swing based RCP). Among many useful things, it comes with an Update Center/ Auto Update Service: http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-autoupdate-services/overview-summary.html

Puce
  • 37,247
  • 13
  • 80
  • 152
1

I would suggest that you have a look at JRebel. It can perform updates to classes during runtime. Here's a list of features (from their home page):

  • Changes to method bodies
  • Adding/removing Methods
  • Adding/removing constructors
  • Adding/removing fields
  • Adding/removing classes
  • Adding/removing annotations
  • Changing static field value
  • Adding/removing enum values
  • Changing interfaces
  • Replacing superclass
aioobe
  • 413,195
  • 112
  • 811
  • 826
  • With JRebel it works directly from the source code..Ok so what happens if the application is on another system and I make a change? How is it going to update that? Thanks a lot – DaMainBoss May 19 '11 at 20:01
0

There are different pieces to consider here. I see three separate problems.

  1. Your application needs to be broken down into separate pieces that can be "pluggably" replaced. While in principle you could replace individual classes, practically the chances of one class in isolation needing to change is small so you need some higher granuarity of module. Two possible approaches are Java EE modules (EARs, WARs) and OSGi as used in Eclipse. In each case there is a well-defined set of capabilities for loading and unloading modules. While you could build such a thing using Java's Classloader capability it's a lot of work, and it seems a shame to reinvent OSGi or some such. But this presupposes that your application is well-designed in modular pieces. It would be really touch to retrofit such modularity.
  2. You need an infrastructure capable of detecting and fetching new versions of modules and deploying them. As I've suggested there are some opensource capabilities along these lines - look at how Eclipse manages its OSGi updates.
  3. How to manage a large distributed estate of such modular applications, where different instances need to communicate. I think this is very tricky, and I'd love to hear about solutions to this problem.
Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
djna
  • 54,992
  • 14
  • 74
  • 117
  • am not sure i understand fully but would rea this over and over and would ask if i have any problem..thanks – DaMainBoss May 21 '11 at 19:51