Wednesday, March 16, 2011

Best free tool to build an exe from Java code?

I've used JSmoothGen in the past, but recently we've seen a number of machines that refuse to run the .exes that it generates. It also seems not to be actively maintained so heavily any more.

Are there any alternatives that are more actively maintained and more reliable?

From stackoverflow
  • The gnu compiler gcj

    jsight : I'm looking for more of a wrapper than a full to .exe compiler. I already know there isn't one of those that is fully compatible (though GCJ is much better than it used to be).
  • 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.

    jsight : Perfect... thanks!
  • I found this article to be very informative

    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.

  • This question is a duplicate of How can I convert my java program to an .exe file? in my eyes.

    PhiLho : Well, there is "best" and "free" added in the title... But it is nice to link to another resource.
  • 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) 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.




Post a Comment