GCJ Swing/AWT working on OS X -- article

John Gabriele john3g@bestweb.net
Wed Jul 21 23:55:00 GMT 2004


On Jul 21, 2004, at 7:11 PM, Bryce McKinlay wrote:

> John Gabriele wrote:
>
>>
>> john$ ./bar
>> Exception in thread "main" java.awt.AWTError: Cannot load AWT 
>> toolkit:  gnu.java.awt.peer.gtk.GtkToolkit
>>    <<No stacktrace available>>
>> Caused by: java.lang.ClassNotFoundException:  
>> gnu.java.awt.peer.gtk.GtkToolkit not found in [file:./, core:/]
>>    <<No stacktrace available>>
>>
>> john$ export CLASSPATH=/usr/local/gcc_cvs/share/java/libgcj-3.5.0.jar
>>
>> john$ ./bar
>> false
>> true
>> {i.e. it starts up and runs as it should.}
>
>
> Odd. For some reason the compiled versions of the Gtk AWT peer classes 
> couldn't be found. By putting them on the classpath, you'll be running 
> interpreted bytecode, not natively compiled code. This will reduce 
> performance.
>
> Regards
>
> Bryce
>

Thanks Bryce.

Should I be adding a '-l' arg to my build command line?
(note, my gnome-related libs are in ~/src/gnome/objdir/lib)
Hmm... here's what that gets me:

~/temp/gcj_stuff $ gcj -o baz --main=TestAWT -l ~/src/gnome/objdir/lib 
TestAWT.java
/usr/bin/ld: can't locate file for: -l/Users/john/src/gnome/objdir/lib
collect2: ld returned 1 exit status

---J



More information about the Java mailing list