By using eclipse export wizard, you can get executable jar files. But the jar file can be only launched by using command lines. Apparently, this is not a good option for most regular not-java-programmer users, especially if the program requires user's input to proceed. We need a program which can be started by double clicking.
To convert .jar file to windows executable file, there is a good tool called launch4j. You can easily convert a jar file to exe, then your users can double click the icon and start the program.
Here is a snapshot of this tool:
How to use launchrj is very straightforward and it's free without any strings attached.
The following is some other features it has:
- JAR files can be included into an executable file;
- Execute Java applications with any current directory;
- Java applications can make use of file type association;
- Java applications are viewed as native Windows programs (and you can create Windows shortcuts for your Java application in the Start menu or on the desktop);
- Use the icon (.ico file) of your choice or design for your executable;
- Fully localizable messages of the executable
As you will see in my later post, there is a a good eclipse plugin -- fat jar which convert all java files to one jar file. You can first use fat jar to get one jar, then use launch4j to convert it to .exe file.
If you want to post code, please put the code inside <pre> and </pre> tags.