Isn't it exactly (almost maybe
) like compiling g++?. To compile:
gcj -c -g -O Hello.java
to link it, use the command:
gcj --main=Hello -o Hello Hello.o
The only thing different is the "--main=Hello" thing, that, as far as I understand, refers to the main class from your code(?). That should create an executable called "Hello", that you should be able to run with ./Hello. Otherwise, make it executable (chmod +x Hello).
If you want to create .class files like javac does, use -C as argument (gcj -C).
Last time I've checked, gcj had support to java.lang, java.io, java.util, java.net, java.security, java.sql and java.math packages, but not graphical ones like AWT and Swing.
As you see, there're many limitations using gcj, specially when it comes down to gui's applications. Personally, I love Java, but I dislike many things coming from Sun, one of them, is letting Java being closed source, thus, not very suitable for Open Source projects. Let's keep out fingers crossed for gcj