This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: removing or using AWT/Swing
Tom Tromey wrote:
"Marco" == Marco Trudel <mtrudel@gmx.ch> writes:
Marco> Then I guess the question is: how do I build with peers? I tested AWT
Marco> with a GCJ that was compiled with "--enable-java-awt=gtk" but get the
Marco> same error. Do I need an additional flag when compiling the final
Marco> executable?
I use --enable-java-awt=gtk and it works for me.
Did you 'make install'?
It doesn't work if gcc is compiled statically...
As soon as I remove --disable-shared from my gcc build command, AWT
works. Any ideas?
Btw, there seems a problem with stacktraces too (I work on linux):
If I add -s, the stacktrace is the attached textfile. If I do not
compile with -s, I get:
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
gnu.java.awt.peer.gtk.GtkToolkit
*** Got java.lang.NullPointerException while trying to print stack trace.
The same if I add -g.
Marco
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
at java.awt.Toolkit.getDefaultToolkit(static-with-peer)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(static-with-peer)
at java.awt.Window.<init>(static-with-peer)
at java.awt.Frame.<init>(static-with-peer)
at AwtTest.<init>(static-with-peer)
at AwtTest.main(static-with-peer)
Caused by: java.lang.ClassNotFoundException: gnu.java.awt.peer.gtk.GtkToolkit not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(static-with-peer)
at java.lang.ClassLoader.loadClass(static-with-peer)
at java.lang.ClassLoader.loadClass(static-with-peer)
at java.lang.Class.forName(static-with-peer)
at java.awt.Toolkit.getDefaultToolkit(static-with-peer)
...5 more