I want to distribute a swing app to my client. In that application two property file are there, which should be visible to client so that they can edit, I can not give it as runnable jar. Also I want something like apache-tomcat zip file which once you extract it will arrange folder structure also will give property file to edit and on next run it reads that property. Also apache-tomcat starts with startup.bat or startup.sh like that I also want.
-
@Sathish IDE should not matter in this case. – Guillaume Polet Aug 31 '12 at 08:27
3 Answers
Use Java Web Start to install and update the application.
User editable properties
- Put them in (a properties file in) the Jar
- When you go to check for the properties, do so using the
PersistenceService
. If they do not exist, read them from the text file in the Jar, and put them there. Here is a demo. of the service. - When the user wants to see/edit the properties, show them via a
JOptionPane
.
Desktop integration
JWS offers desktop shortcuts and menu items to launch apps., when supported by the platform, as well as an API to install and remove them (see the IntegrationService
). Much slicker than batch files!

- 1
- 1

- 168,117
- 40
- 217
- 433
Currently we are using GetDown to handle distribution of our swing applications. We use Tomcat to distribute updates and GetDown to download those updates. It's really flexible and powerful, and much better than java WebStart.
A good tutorial : http://www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/
Project website : http://code.google.com/p/getdown/

- 4,396
- 4
- 29
- 30
-
-
It can generate check sum for all files then GetDown will download all changed files from server to client. it can work based on version or check sum, supports resume and has maven integration. Actually we needed such a tool and tried many tools, finally decided to use this tool. check the project web site for more info. with GetDown, maven and some shell script we developed a great update mechanism for our swing application with just one build. – Mehdi Aug 31 '12 at 11:44
-
1) Maven - not sure what you mean, but I am sure JWS apps. can be deployed via Maven, and the JWS client would probably do whatever Maven does, from the client-side (e.g. lazy downloads), better. 2) JWS not only supports lazy downloads and 'update when needed', but also programmatic (e.g. your app.) control of downloads. Of course downloads can be further partitioned by OS (handy for natives) or Java version. 3) JWS provides a secure environment for apps. (digital signing, 3 levels of security) 4) JWS is supported/supplied by the manufacturer of Java. -- Your need for very specific .. – Andrew Thompson Aug 31 '12 at 11:53
-
..requirements and satisfaction with 'GetDown' simply does not add up to 'much better than Web Start'. – Andrew Thompson Aug 31 '12 at 11:54
-
yes you might be right! but first of all take a look at project website, and see the features of this project. with this tool we are even able to update JRE version! does JWS support that! of course we did some hacks and shell script, if you have the experience with swing application distribution you will get the differences after reading the project wiki. GetDown works with HTTP protocol and SSL will make communication secure. – Mehdi Aug 31 '12 at 12:00
-
GetDown was really much flexible that JWS and we were allowed to do a lot of things including updating JRE! of course you are right about requirement of projects. – Mehdi Aug 31 '12 at 12:03
If I understand you correctly you want a tool to make distribution package for your application. That generates folder structure and unpacks application and data files to this structure.
There are many free and commercial setup builders. I think you would prefer multi-platform builder, so look for java setup builder.
Check this thread, this question was discussed there.

- 1
- 1