1

I've written a Java Swing Program using the Eclipse IDE and I would like to distribute it as a .exe on windows. It has three classes in it and imports from java.awt, java.awt.event, java.io, java.net, javax.swing and javax.swing.filechooser. All of the files are in a package called "notes". It doesn't import any other JARs.

How would I go about converting this into a .exe and what would the .exe need to be distributed with (e.g. class files etc.).

Sumit Bijvani
  • 8,154
  • 17
  • 50
  • 82
notquiteamonad
  • 1,159
  • 2
  • 12
  • 28
  • 1
    This has been re-hashed on this and many other sites. First please tell us, what are the results of your searching on this subject? Including your review of the many strong arguments *against* doing this as well on the other hand the numerous how-to links on just how to do this. – Hovercraft Full Of Eels Oct 26 '13 at 14:17
  • 1
    For example your question is a possible duplicate of [Packaging Java apps for the Windows/Linux desktop](http://stackoverflow.com/questions/7720/packaging-java-apps-for-the-windows-linux-desktop). – Hovercraft Full Of Eels Oct 26 '13 at 14:19
  • Thanks, I have previously researched this finding results including tools to use. However, when trying to package these everything seems fine until a client downloads it and I get a "Class Not Found" error. – notquiteamonad Oct 26 '13 at 14:21
  • 1
    The subject is huge, the posts, debates, arguments even are out there and are long-winded, and rather than having us re-hash all of it all over again, you really should post more of the results of your searches. Not to do so is not fair and is a tad lazy. Myself, I'm of the camp that it's not worth the expense or effort, for to do this well you'll likely have to pay money for a good library, like the [Excelsor library](http://www.excelsior-usa.com/articles/java-to-exe.html). Better to create and distribute a well packaged jar file, perhaps using Java web-start for distribution. – Hovercraft Full Of Eels Oct 26 '13 at 14:23
  • I ended up packaging the whole project and just using a jar file for execution but thanks everyone for trying. – notquiteamonad Oct 27 '13 at 20:34
  • 1
    that's probably the best solution. – Hovercraft Full Of Eels Oct 27 '13 at 20:44

1 Answers1

1

Try using a packager like launch4j or something.

launch4j: http://launch4j.sourceforge.net/

DRH1469
  • 91
  • 1
  • 7