If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file?
I also need an installer for my program.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
javapackager
The
javapackagerutility ships with the JDK. It can generate .exe files with the-native exeflag, among many other things.WinRun4J
WinRun4J is an open source utility. It has many features.
packr
packr is another open source tool.
JSmooth
JSmooth is open source and has features, but it is very old. The last release was in 2007.
JexePack
JexePack is trialware. Payment is required for production use, and exe files created with this tool will display "reminders" without payment. Also, the last release was in 2013.
InstallAnywhere
InstallAnywhere is a commercial/enterprise package that generates installers for Java-based programs. It’s probably capable of creating .exe files.
Executable JAR files
As an alternative to .exe files, you can create a JAR file that automatically runs when double-clicked, by adding an entry point to the JAR manifest.
For more information
An excellent source of information on this topic is this article, "Convert Java to EXE – Why, When, When Not and How", by Dmitry Leskov
See also the companion page "Best JAR to EXE Conversion Tools, Free and Commercial"