Best free tool to build an exe from Java code? [duplicate]

青春壹個敷衍的年華 提交于 2019-11-27 23:05:27

I use Launch4J which supports Windows, Mac and Linux. I suggest forgoing the somewhat flaky GUI tool and just writing the (short, readable) config file yourself.

The gnu compiler gcj

I found this article to be very informative http://www.excelsior-usa.com/articles/java-to-exe.html.

Someone already mentioned Launch4j, however, I found Jsmooth to be alittle better. They are both very similar, but I would mess with both to see which you prefer.

EDIT: Sorry, I somehow skimmed over your mention of Jsmooth in your question. If Jsmooth isn't working for you, then I would go for Launch4j. I still recommend that article.

It is also not entirely necessary to make an .exe. On Windows, at least, .jar files are executable so long as there is a Java runtime installed and the .jar extension has been set up on the machine.

[NOTE: I just discovered that something that has broken the file association, which had previously worked for me. It now only works when I am administrator, and the JAR icon even disappears otherwise. I assume that some recent install has messed with that and the candidates are (1) OpenOffice.org 3.0, (2) WinRAR, or (3) a Java update download. However, the following all work when the association is made to work.]

The "program" Clicker.jar runs as a Java application when (1) I double-click on it in a Windows Explorer window, (2) When I create a console shell where I am in the same directory and I perform the command ">Clicker.jar" (3) when I send a shortcut to my desktop and double-click on it, and (4) when I put the full path in the Windows XP Run ... box.

I don't know that these will be found in a PATH search, and I normally wouldn't arrange that anyhow.

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