Java Compiler Options to produce .exe files

后端 未结 1 1038
無奈伤痛
無奈伤痛 2020-12-09 06:28

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条回答
  • 2020-12-09 07:27

    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
    
    0 讨论(0)
提交回复
热议问题