Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Compiler Options to produce .exe files

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?

like image 283
Rodrigo Amaya Avatar asked Sep 10 '08 12:09

Rodrigo Amaya


1 Answers

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
like image 70
Bill the Lizard Avatar answered Sep 19 '22 06:09

Bill the Lizard