How to generate executable of java project in eclipse [duplicate]

泪湿孤枕 提交于 2019-12-10 04:18:55

问题


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?


回答1:


I recommend launch4j to create executables from JAR files.




回答2:


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




回答3:


First export your project as a *.jar in eclipse.

Then, you can use JSmooth to make an *.exe file.

Links:

http://www.vogella.com/articles/Eclipse/article.html

http://jsmooth.sourceforge.net/docs/jsmooth-doc.html




回答4:


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.




回答5:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!