How do I create an .exe for a Java program? [duplicate]
Possible Duplicate:
How can I convert my java program to an .exe file ?
I'd like to create a Windows .exe for a Java program. Previously, I've used JEXECreator for this, but it's not entirely satisfactory because:
- The executable sometimes works on the machine on which it was created but not on others.
- The program is commercial; if you use the trial version, it adds a nag screen to your application.
I don't need the generated .exe to work if Java is not installed on the target machine (in fact, I think this is impossible).
Any recommendations?
Solution 1:
Launch4j perhaps? Can't say I've used it myself, but it sounds like what you're after.
Solution 2:
Most of the programs that convert java applications to .exe files are just wrappers around the program, and the end user will still need the JRE installed to run it. As far as I know there aren't any converters that will make it a native executable from bytecode (There have been attempts, but if any turned out successful you would hear of them by now).
As for wrappers, the best ones i've used (as previously suggested) are:
JSmooth
and
Launch4j
best of luck!
Solution 3:
If you really want an exe Excelsior JET is a professional level product that compiles to native code:
http://www.excelsior-usa.com/jet.html
You can also look at JSMooth:
http://jsmooth.sourceforge.net/
And if your application is compatible with its compatible with AWT/Apache classpath then GCJ compiles to native exe.
Solution 4:
I used exe4j to package all java jars into one final .exe file, which user can use it as normal windows application.