开发者

How to make executable program in java? [duplicate]

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

Possible Duplicate:

How can I convert my Java program to an .exe file? 开发者_StackOverflow

How to make executable program in java?


You don't really need to, there are a number of other options available:

  • As Philip suggested you can use an executable jar file. See http://www.ibm.com/developerworks/library/j-jar/index.html
  • You can build on top of a framework that already has its own launcher such as Eclipse. See http://wiki.eclipse.org/index.php/Rich_Client_Platform
  • You can use a technology such as Java web start to launch your app from a browser. See http://en.wikipedia.org/wiki/Java_Web_Start (or just package your app as an applet)


probably this may help you http://www.javacoffeebreak.com/faq/faq0042.html

there he talks about nice tool called Java2Exe which serves your purpose


The common way is the following:

  1. compile your class files: javac *.class
  2. create a jar file (it's basically a .zip-file):
    • echo Main-Class: MyMainClassName > manifest.txt
    • jar cvfm MyOwnJarfile.jar manifest.txt *.class
  3. create a .bat-script (or sh script if your are on unix):
    • echo java -jar MyOwnJarfile.jar > start.bat
  4. Double-Click on start.bat ;-)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜