testing xlib peers

stewart@neuron.com stewart@neuron.com
Thu May 17 23:16:00 GMT 2001


I grabbed yesterday's source snapshot and built it with xlib peers. I then
wrote a simple program:

import java.awt.*;
public class a
{
	public static void main(String args[]) throws Exception
	{
		Frame f = new Frame("foo!");
		f.add(new Button("Button"));
		f.pack();
		f.show();
	}
}

and compiled it with:

gcj -o a a.java --main=a -lgcj -lgcjx -lstdc++

(dunno, but it wouldn't build w/o -lstdc++. I also tried -lgtk -lgdk)

and ran it which yielded:

Exception in thread "main" java.awt.AWTError: Toolkit class
gnu.awt.gtk.GtkToolkit could not be initialized:
  java.lang.ClassNotFoundException: gnu.awt.gtk.GtkToolkit
   at 0x4018a3aa: java.lang.Throwable.Throwable(java.lang.String)
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x4017f92f: java.lang.Error.Error(java.lang.String)
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x4023f7df: java.awt.AWTError.AWTError(java.lang.String)
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x40255099: java.awt.Toolkit.getDefaultToolkit()
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x402557c7: java.awt.Window.getToolkit()
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x4024da9e: java.awt.Frame.addNotify()
(/home/stewart/gcc/lib/libgcj.so.2)   at 0x402554fe: java.awt.Window.pack()
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x08048b6b: a.main(java.lang.String[])
(/home2/stewart/devel/current/gcj/awt/a.java:9)
   at 0x401690bb: gnu.gcj.runtime.FirstThread.run()
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x40173f32: java.lang.Thread.run_(java.lang.Object)
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x40280d85: _Jv_ThreadSetPriority(_Jv_Thread_t, int)
(/home/stewart/gcc/lib/libgcj.so.2)
   at 0x4059162c: GC_start_routine (/home/stewart/gcc/lib/libgcjgc.so.1)
   at 0x405ab817: pthread_detach (/lib/libpthread.so.0)
   at 0x406b252a: __clone (/lib/libc.so.6)

is there any updated info on how to make this work?

thanks,

stewart




More information about the Java mailing list