This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: removing or using AWT/Swing
Marco Trudel writes:
> 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.
>
> 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}}
Is gnu.java.awt.peer.gtk.GtkToolkit in a jar file in your classpath?
We can't use the precompiled shared library, becasue you've disabled
it with --disable-shared.
Andrew.