Java Compiler Options to produce .exe files

↘锁芯ラ 提交于 2020-01-09 09:40:12

问题


What compiler (I'm using gcj 4.x) options should I use to generate an "exe" file for my java application to run in windows?


回答1:


To compile the Java program MyJavaProg.java, type:

gcj -c -g -O MyJavaProg.java

To link it, use the command:

gcj --main=MyJavaProg -o MyJavaProg MyJavaProg.o

and then linking to create an executable mycxxprog.exe

g++ -o mycxxprog.exe mycxxprog.o


来源:https://stackoverflow.com/questions/53845/java-compiler-options-to-produce-exe-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!