This question already has an answer here:
I am trying to make an executable file of my Java Application but I don't know how to do that.
I know how to generate an executable jar file, but I want to make an executable application.
I'm using eclipse indigo to make the java application and to generate the jar file.
How to make the executable?
I recommend launch4j to create executables from JAR files.
You can use JSMOOTH to wrap your jar file into .exe file. from wiki ->JSmooth is a tool for wrapping Java JAR files into Windows Portable Executable EXE files.
For more info you can see this answer
First export your project as a *.jar
in eclipse.
Then, you can use JSmooth to make an *.exe
file.
Links:
The most common way to generate an EXE from a jar file is to use whats known as a "wrapper".
one of the more popular wrappers is http://www.jwrapper.com/ which i belive mojang uses to wrap minecraft for windows.
However if you want to generate a purely native EXE that runs as a standalone you will need a native compiler for example: http://jnc.mtsystems.ch.
At the end of the day java is designed to run on a VM double clicking on windows opens it up anyway, but if you really do want to make an EXE then the above methods should work.
Many years ago Microsoft use to be able to generate exe from java code, but I do not believe that Eclipse has this feature.
来源:https://stackoverflow.com/questions/18458682/how-to-generate-executable-of-java-project-in-eclipse