Installer for Java Applications - java

I need to create an installer for my java desktop application. I don't like to code an installer by hand. is there anyway I can create an installer for Java applications?

If your looking to create an installer for windows applications check out Advanced Installer. For linux based machines, I'd just got with the regular tar.gz file and a README file.

Pack Jacket software:
This is a freeware with a simple GUI. Available to download from sourceforge. This file is capable of creating installers with extensions .exe, .jar and much more. The complete tutorial is available in youtube. Just search "How to make installer for regular java project" in youtube and the first result, you will find the tutorial (I tried to paste the link here, but stackoverflow didn't allow it :( ).
IZPack:
IZpack doesn't have any GUI, just some files. You have to do it manually. It takes xml files as parameters which instruct it how to create the installer. The tutorial for using IZpack is here. I am using IZpack and personally I like it more than pack jacket.
There are more apps for creating these installers, but according to my knowledge these are the most famous because I have seen these installers in number of applications I have used.
Hope you can make your work easy by reading this :)

..installer for my java desktop application.
Deliver it over the net using Java Web Start.
Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

Related

How to make Windows autoview a file with my program, and how to make the program read it?

I want it like when we do "open with" and then choose Notepad. So that when I "open with" a file there will be my program in the list. How to associate a file type with my program?
How to make the program handle the file?
Deploy the app. using Java Web Start.
Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..
This demo. of the file service is deployed using JWS (on OS X, *nix and Windows) and declares an interest in the .zzz file-type.
Best thing would be to create an EXE wrapper for your Java program:
How can I convert my Java program to an .exe file?
and
Best free tool to build an exe from Java code?
are relevant. Then you would need to create a file association. See this KB article on how to do it manually:
http://support.microsoft.com/kb/307859
If you use an installer package to package your app you would have to research on how to accomplish this automatically when your program installs.

Windows/Linux installer for Java program

I have several Java applications. All of them have external jar dependencies and also require a couple of .dll/.so files to run. I want to build an installer for these applications, that will run properly just by double-clicking the installed program. What tools are available to do this ?
Thanks in advance.
For Windows Izpack is good tool. Also native implementation available.
But for Linux the best is to install it with a .sh script.
Edit
The reason for this is that when you use a .sh script, you can check if java is installed and install it if it's not present. As I am aware- Izpack still lacks this feature.
..run properly just by double-clicking the installed program
This implies a rich client desktop app. rather than one based on the command line. In that case, the best deployment technology is Java Web Start.
Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

Editing a .jar file with a .jar file

I have written an updater program for my friend to update another program I wrote for her as a going away gift. I have written all the needed code for retriving the class files that are updated from a server and holding them in temporary memory. What I need help with is having the program replace the class files in the first jar file so she doesn't have to do manual updates. Note: The main program is not running during update so no exploding jars.
So long as the app. has a GUI, deploy it using Java Web Start.
Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation1 for platforms that support Java.
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update2 (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..
It is easy for the user.
Automatic update is built-in, all the deployer has to do is upload the new Jar.
If Java Web Start is not what you're looking for and if the jar executable is available on your friend's computer (either because a JDK is installed on your friend's machine or you distribute it with your application), you can run
jar uf jar-file input-file(s)
If you want to call the jar executable from within a Java program, just use Runtime.exec. For a more in-depth discussion about updating a JAR via the jar executable, see Sun Developer Network's article "Updating a JAR File."

How to implement auto update in Java?

All:
I am facing a problem here, my app is composed by some jar files and some other files, they are all located in one directory. I am planning to implement an auto-update feature. When the app know there is a new version on the server, it will download a zip file to temp directory. After downloading, it will ask customer if he'd like to install it. If yes, my app will exit and I need to unzip the zip file and overwrite all files in the original directory. Now I am wondering:
How can I unzip the file and overwrite the directory? Create a script (which means I need to write bat for Windows and shell for other platforms)? Create a java class to do it?
How can I start this script/ java class after exiting?
Once the job is done, how do I delete the installer? Keep it in temp directory and check it out when new version app start?
From later comments:
I know JWS is a good choice, but for reason "my boss denied", I can't use it.
There could be several approaches. Since you say the application is cross-platform, it would be wise to use Java for update.
You can create a small jar file which will handle the update process. It could be part of the initial application (with the assumption it won't be updated) or it could be part of the update package (then you can update it as well).
So your application downloads zip, unpacks it to a temporary directory and starts the updater, then it exits. The updater copies new jars over the old ones.
Yet it's better to not reinvent the wheel. Consider using JWS: it provides more features and requires less effort to implement. There must be good reasons to deny JWS. You should persuade your boss by explaining the benefits of using JWS.
Since the app. has a GUI (judging by the Swing tag), deploy it using Java Web Start:
Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

How to distribute Java-based software?

Now, don't get me wrong, I am a very competent programmer, but when I program, I typically develop things for the web using scripting languages like JavaScript, PHP, Python, SQL, etc. If I want to develop Java software (I am relatively experienced in Java), how do I distribute it?
Is there any good way to package up Java software in a nice little executable, send it out, and have it run? Alternatively, is there any good way to package up Java in some sort of installer, and send it out to be installed and run?
I'm using Launch4J http://launch4j.sourceforge.net/ it will generate an .exe executable for Windows, if the targeted system don't have JVM, it will tell user to download and get JVM.
You can package Java applications in so called jar-files using the jar tool or any competent Java IDE. These jar-files are self-contained and seldom need any installer.
These .jar files can easily be distributed and executed.
If you're used to web-development, you may also be interested in the Java Webstart technology.
Some links to get you started.
Export to a .jar-file in Eclipse
Lesson: Java Webstart
I have found two approaches to work well, depending on the needs of the end user.
1) Java WebStart - allows for central distribution and easy maintenance, but works best for online users. Require you to have a web site to locate the files - these days this is easy to do on the Google Application Engine.
2) Wrapping up the Java program in a single jar using one-jar, and then using jsmooth to generate an .EXE file which ensures Java is available, extracts the jar-file and invokes Java on it. This works well for users not always on the net, where you want the launch process to be transparent, but is less easy to upgrade than the webstart approach.
I use Maven to handle all the dependencies of my projects and that way when you utilise Maven to build your projects they will compile into one nice executable jar that contains everything so you dont need to worry about getting all your third-party jars in the right place etc.
There are a couple of ways: one is to create an installer that allows your user to install and run it. For this you can take a look at NSIS.... or you can just use Java Web Start where your user can just click the link and launch your application.
Here you will find a large set of options: Open Source Installers Generators in JavaIt is very useful for the "naive" customer or user of your application, to make the installation process as painless as possible. Let them install whatever is needed, DBMS, JVM, JMF and additional options via one installer.
You can also consider use one of the rich client platforms available for Java. The learning curve is probably a lot higher than just creating a jar file and ship it, but you will get a lot for free when it comes to distribution. (Think Eclipse with auto update through an update site).
Do a search for "Eclipse RCP" and "Netbeans RCP" and you'll find the two biggest contenders here. I also performed a serach for "eclipse RCP installer" and one of the hits seems interesting:
http://download.instantiations.com/RCPPackagerDoc/integration/latest/docs/html/gettingstarted/GenInstaller.html
I personally like izpack. It generates a jar file installer that you could wrap up in launch4j, supports things like windows specific shortcuts, is highly customisable through XML and hooks directly into ant.
OneJar is great for smaller stuff, but for larger programs or applications it's nowhere near as flexible and in my experience is rather slow.
Hello you can make an installer for your application.
In the link below you will find a nice help about izpack installer.
http://www.imrantariq.com/blog/?p=89
Link below contains a detailed pdf to make installer with izpack.
http://www.imrantariq.com/blog/?attachment_id=112
cheers

Categories