This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Generate an exe file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Generate an exe file?" Watch "Generate an exe file?" New topic

Generate an exe file?

Gurukant Desai

Joined: Aug 18, 2007
Posts: 2
How to convert java programs to windows .exe files using eclipse?
How are the applications such as Azureus, limewire etc packaged into an exe installer?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

There are a number of programs that compile Java into a Windows exe.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45335
I am not sure you either can or want to create .exe files.
What you do is to create an executable .jar file.
If I remember correctly, this is how you do it in Eclipse:
  • Right-click the name of the project in the left pane.
  • Click export
  • In the new window click the arrowhead near "Java" so expand the list.
  • Click ".JAR file"
  • Click "Next"
  • Enter a name for the .jar file
  • Click "next" twice.
  • Put the name of the class with the main method in the box.
  • Click finish.
  • Find the .jar file.
  • Copy a shortcut to it onto the Windows desktop.
  • If your file associations are set up properly, then you can run the application by double-clicking he desktop icon.
  • If you need to add other files to your classpath, search through this forum and find my earlier posts about adding to the classpath.
    Paul Clapham

    Joined: Oct 14, 2005
    Posts: 19864

    Also, just because those applications use a Windows installer to get themselves loaded onto Windows machines, it doesn't follow that the result of the installation is a Windows exe file. If you want to get your application installed on other people's Windows machines, I definitely recommend using a Windows installer to do that. But I don't recommend using those applications that convert your application into a standalone exe file. They usually aren't necessary and often people seize upon them because they don't realize that they can use a standard Windows installer instead.
    I agree. Here's the link:
    subject: Generate an exe file?
    It's not a secret anymore!