GCJ and AWT
Hello,
I am new to GCJ, but not to Java or Debian.
I have a fairly simple application I would like to compile using GCJ in
order to get a native binary. I have succeeded to get my binary, but it
does not work.
As of February 2002, I read on this list archives that AWT was not
usable. However, it seems that since then things may have changed.
What I get is:
Exception in thread "main": java.awt.AWTError: Cannot load AWT toolkit:
gnu.java.awt.peer.gtk.GtkToolkit
being the fourth (and AFAICT important) line of the stack trace:
at ...: java.awt.Toolkit.getDefaultToolkit() ...
I compiled it with:
gcj-3.2 --main=MyMainClass -o MyMainClass *.java
If I try the jikes-compiled version of it, packaged in a jar, like:
gij-3.2 -jar myjar.jar
I get exactly the same error.
I have tried to install the classpath package, and to export
LD_LIBRARY_PATH=/usr/lib/classpath before I try to run my app, but it
does not seem to help at all.
If I ldd MyMainClass, I do not get any broken library reference.
I saw that there are some unavailable classes, such as GridBagLayout,
but I rewrote the code to avoid this little hassle. So now it compiles
OK, but it does not run.
BTW, before the stack dump, I get the two following lines:
returned
end
Can anyone point me to the right direction?
I did not find much info on http://www.gnu.org/gcc/java
Thank you very much for any hint!
Antonio Fiol
Reply to: