Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create an .exe for a Java program? [duplicate]

Tags:

java

exe

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?

like image 900
Dónal Avatar asked Feb 05 '09 15:02

Dónal


People also ask

Can you make exe from Java?

Making a executable fileTo make a executable file, we will need a separate tool for it called Launch4j. The download link for this software is down below. Launch the software after installing it and follow the following guidelines. Add you own path for the Output file (Where you want to save it).

What is exe equivalent in Java?

Java "executables" are either . class or . jar files. It's common to deliver a script ( .


2 Answers

Launch4j perhaps? Can't say I've used it myself, but it sounds like what you're after.

like image 154
Jon Skeet Avatar answered Sep 20 '22 16:09

Jon Skeet


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!

like image 22
John T Avatar answered Sep 19 '22 16:09

John T