problems with the AWT

Patrick Amar Patrick.Amar@lri.fr
Wed Dec 13 08:00:00 GMT 2000


Hello,

I have successfully downloaded, compiled and installed the gcc tree from
cvs today (dec. 13 2000); I have successfully compiled the simple java
program below, and the execution failed about a class not found:

   gnu.awt.gtk.GtkToolkit

I looked at the sources and this class (and some others) is there !
did I miss something ??

(I have got the same error with linux RedHat6.0 and RedHat7.0 on a i686 pc)

btw, thanks to all the developers, you have done a great work !

				Patrick Amar (pa@lri.fr)

----------------------------------------------------------------------

here is the example and the test:

% cat Test.java

import java.awt.*;
import java.awt.event.*;

public class Test extends Frame {
	Button	_ok;

	public Test () {
		_ok = new Button ("Ok");

		add (BorderLayout.CENTER, _ok);
		setSize (400, 400);
		_ok.addActionListener (
			new ActionListener () {
				public void actionPerformed (ActionEvent e) {
					System.out.println ("Ok");
				}
			}
		);
	}

	public static void main (String [] args)
	{
		Test t = new Test ();
		t.setVisible (true);
	}
}
% gcj -fmain=Test Test.java -o test
% ldd test
        libgcj.so.1 => /usr/local/lib/libgcj.so.1 (0x40018000)
        libm.so.6 => /lib/libm.so.6 (0x403ef000)
        libgcjgc.so.1 => /usr/local/lib/libgcjgc.so.1 (0x4040f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x4042e000)
        libzgcj.so.0 => /usr/local/lib/libzgcj.so.0 (0x40445000)
        libdl.so.2 => /lib/libdl.so.2 (0x40453000)
        libc.so.6 => /lib/libc.so.6 (0x40456000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
% ./test
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 0x40191c69: java::lang::Throwable::Throwable(java::lang::String *) (/usr/local/lib/libgcj.so.1)
   at 0x401865c0: java::lang::Error::Error(java::lang::String *) (/usr/local/lib/libgcj.so.1)
   at 0x4023a244: java::awt::AWTError::AWTError(java::lang::String *) (/usr/local/lib/libgcj.so.1)
   at 0x4024f9c1: java::awt::Toolkit::getDefaultToolkit(void) (/usr/local/lib/libgcj.so.1)
   at 0x40250557: java::awt::Window::getToolkit(void) (/usr/local/lib/libgcj.so.1)
   at 0x40248d12: java::awt::Frame::addNotify(void) (/usr/local/lib/libgcj.so.1)
   at 0x4025024e: java::awt::Window::show(void) (/usr/local/lib/libgcj.so.1)
   at 0x4023f142: java::awt::Component::show(bool) (/usr/local/lib/libgcj.so.1)
   at 0x4023f0b5: java::awt::Component::setVisible(bool) (/usr/local/lib/libgcj.so.1)
   at 0x08050d15: Test::main(JArray<java::lang::String *> *) (/users/asspro/pa/java/Test.java:0)
   at 0x4016fe17: gnu::gcj::runtime::FirstThread::run(void) (/usr/local/lib/libgcj.so.1)
   at 0x4017a6eb: java::lang::Thread::run_(java::lang::Object *) (/usr/local/lib/libgcj.so.1)
   at 0x402833e5: _Jv_ThreadSetPriority(_Jv_Thread_t *, int) (/usr/local/lib/libgcj.so.1)
   at 0x4041b60c: GC_start_routine (/usr/local/lib/libgcjgc.so.1)
   at 0x4043582d: pthread_detach (/lib/libpthread.so.0)
   at 0x4053731a: __clone (/lib/libc.so.6)
% 


More information about the Java mailing list