开发者

Is there any other way to create an exe file from a java source other than ant script [duplicate]

This question already has answers here: Closed 11 years ago.

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 o开发者_运维技巧ther way to create the exe file.


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:

  • http://www.autexier.de/jmau/dev/gcj.html
  • http://www.dreamincode.net/forums/topic/40425-compiling-java-programs-natively-with-gcj/

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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜