• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating an Update App  RSS feed

 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an app for which I want to be able to provide updates. I've search around for various techniques and I think they are all overkill for my simple need. Essentially there is one critical class of properties that needs to survive an update unchanged. I'm thinking there should be a way to take advantage of the fact that a jar file is in a zip format. My thinking is to somehow copy that one class out of the old jar into the new one and replace the old jar with the update. The solution also needs to be platform independent. Any ideas or suggestions would be appreciated.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the problem. What does it mean for a class to "survive an update unchanged"? How does that differ from just distributing the same class in the update?
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The properties in that class are static and unique to that specific copy of the app. It contains information specific for that user.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it wasn't possible to simply send it over again when the user downloaded the updated version, then I would distribute it in a separate jar from the updatable part of the application.
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was hoping to avoid using 2 jars but maybe I need to rethink that. Thanks.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you can use Java Web Start instead.
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read about that but it seems like it is geared toward Applets not standalone apps. In thinking about this more, I don't understand the interaction between different jar files but is there not a way to read the properties from the old jar and store them in the properties file of the new jar? Then I could simply replace the old with the new.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JWS is definitely not geared towards applets. I would sooner call it a replacement for applets. It will download and run the application on your own desktop and not inside a web browser.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dennis Putnam wrote:I read about that but it seems like it is geared toward Applets not standalone apps.


Then you really didn't read very well. You basically got it completely backwards. Try again.

In thinking about this more, I don't understand the interaction between different jar files but is there not a way to read the properties from the old jar and store them in the properties file of the new jar? Then I could simply replace the old with the new.


Sure, you could do that when you create the new jar to be deployed, as I already suggested. There is no way to update the contents of a jar once it has been created. As for the "interaction" you mentioned, I don't know what you meant by that.
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
Then you really didn't read very well. You basically got it completely backwards. Try again.


I went by what Oracle said:

Overview

Java Web Start is an application-deployment technology that gives you the power to launch full-featured applications with a single click from your Web browser. You can now download and launch applications, such as a complete spreadsheet program or an Internet chat client, without going through complicated installation procedures.

Java Web Start includes the security features of the Java platform, so the integrity of your data and files is never compromised. In addition, Java Web Start technology enables you to use the latest Java SE technology with any browser.

With Java Web Start, you launch applications simply by clicking on a Web page link. If the application is not present on your computer, Java Web Start automatically downloads all necessary files. It then caches the files on your computer so the application is always ready to be relaunched anytime you want—either from an icon on your desktop or from the browser link. And no matter which method you use to launch the application, the most current version of the application is always presented to you.

There is no browser involved. The update will be emailed as an attachment.

Paul Clapham wrote:
As for the "interaction" you mentioned, I don't know what you meant by that.

It seems to me that if I can reference class methods in the old jar file from the update file then I can obtain the information I want and I know what to do from there. The issue is how do I reference classes an external jar?
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dennis Putnam wrote:
Paul Clapham wrote:
Then you really didn't read very well. You basically got it completely backwards. Try again.


I went by what Oracle said:


Which doesn't mention applets at all, right?

Dennis Putnam wrote:The issue is how do I reference classes an external jar?


What?
 
Dennis Putnam
Ranch Hand
Posts: 377
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
Then you really didn't read very well. You basically got it completely backwards. Try again.

Sorry for being so dense but I guess I don't understand what this means then:

Java Web Start is an application-deployment technology that gives you the power to launch full-featured applications with a single click from your Web browser.

or

With Java Web Start, you launch applications simply by clicking on a Web page link.
Paul Clapham wrote:
Which doesn't mention applets at all, right?

Nor does is mention standalone applications. What am I missing? I feel like an idiot.
Paul Clapham wrote:
What?

Keep in mind you are talking to a Java noob. If I have a.jar and b.jar, can a method in a.jar access a class method in b.jar (other than main)? If so how?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!