0

Possible Duplicate:
How can I convert my Java program to an .exe file?

I need to create an exe file from my java source. My requirement is to use other ways except ant script. Is there any other way to create the exe file.

Community
  • 1
  • 1
Manikandan
  • 1,479
  • 6
  • 48
  • 89
  • What is the source of such a question? Are you looking to create an .exe? What requirements do you have that eliminate ant as a viable or desired option? – jzd Jun 07 '11 at 12:44
  • 2
    I've heard that Launch4J (http://launch4j.sourceforge.net/) is pretty good – Hunter McMillen Jun 07 '11 at 12:45
  • 1
    Also, have you googled? A quick google search threw up a number of options including JSmooth, JEXECreator amongst others. – spot35 Jun 07 '11 at 12:45
  • 1
    More Info on: http://stackoverflow.com/questions/147181/how-can-i-convert-my-java-program-to-an-exe-file – Sandeep Jindal Jun 07 '11 at 12:59

2 Answers2

2

You could investigate GCJ. The advantage of GCJ is that it is creating a native binary; no JVM is required to run the resulting executable.

$ gcj --main=test -o test.exe test.java

If you are using Windows, you will probably need to install cygwin to compile using GCJ.

Some more verbose tutorials:

GCJ-compiled applications are significantly larger than their Java-compiled counterparts.

Charles Goodwin
  • 6,402
  • 3
  • 34
  • 63
1

You need to be clear about your requirements.

There are various ways to create an EXE from Java. The exe could be native compiled or could be using JRE. GCJ is the example of native compiled exe and Launch4J is an example of exe which is using JRE.

Please refer to following link for more details:

How can I convert my Java program to an .exe file?

Community
  • 1
  • 1
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121