removing or using AWT/Swing

Marco Trudel mtrudel@gmx.ch
Mon Jul 31 12:44:00 GMT 2006


Andrew Haley wrote:
> 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?

During compiling or during execution of the final executable?

My goal is a standalone executable. So I've put 
gnu.java.awt.peer.gtk.GtkToolkit (3 classes) into a jar, compiled to an 
object and added the object to the compilation of the main source (as I 
do with gnu/regexp/MessagesBundle for regular expression).

Compilation failes with the attached error message. It looks like 
GtkToolkit is already there?


> We can't use the precompiled shared library, becasue you've disabled
> it with --disable-shared.

Hm... Why isn't it pulled in automatically? IMHO it would make sense if 
GCC is statically compiled.

Currently, extra files have to be added for different special cases when 
gcj is compiled statically. E.G. for regular expression, probably for 
AWT, for security specifications...
Is it possible to add all these automatically? It's kind of dull to do 
this oneself. Specially because one never knows what else could be 
missing...


regards
Marco
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: out.txt
URL: <http://gcc.gnu.org/pipermail/java/attachments/20060731/818d282e/attachment.txt>


More information about the Java mailing list