From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1951 invoked by alias); 14 Aug 2008 16:59:05 -0000 Received: (qmail 1941 invoked by uid 22791); 14 Aug 2008 16:59:05 -0000 X-Spam-Check-By: sourceware.org Received: from cp-out2.libero.it (HELO cp-out2.libero.it) (212.52.84.102) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 14 Aug 2008 16:58:26 +0000 Received: from libero.it (192.168.17.4) by cp-out2.libero.it (8.5.014) id 48873481017C8DA0; Thu, 14 Aug 2008 18:58:22 +0200 Date: Thu, 14 Aug 2008 16:59:00 -0000 Message-Id: Subject: Re: gcj 4.4 and AWT toolkit MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable From: "ffileppo" To: "mark" Cc: "java" X-XaM3-API-Version: 4.3 (R1) (B3pl25) X-SenderIP: 87.5.170.15 X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00034.txt.bz2 > I am now seeing your failure also. Don't know why I wasn't seeing it > earlier. But I must have tried the wrong thing since I now see why it > cannot have worked. > > The latest GNU Classpath import added this patch: > > 2008-02-08 Roman Kennke > > * gnu/java/awt/peer/gtk/CairoGraphics2D.java, > * gnu/java/awt/peer/gtk/GdkFontPeer.java, > * gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java, > * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java, > * gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java, > * gnu/java/awt/peer/gtk/GtkComponentPeer.java, > * gnu/java/awt/peer/gtk/GtkToolkit.java: Only call > System.loadLibrary() when configured so. > > As Roman explained: > > This changes the System.loadLibrary() calls in the GTK peers, so > that they are only called when configured so. This is important > for VMs that can't or don't want to link dynamically, e.g. when > creating full static linked binaries like Jamaica. > > And indeed libgcj has a gnu/classpath/Configuration.java which defines > INIT_LOAD_LIBRARY =3D false. And so gtkpeer.so is never loaded. Causing > the native jni function call to not resolve giving the > java.awt.AWTError: Cannot load AWT toolkit: > gnu.java.awt.peer.gtk.GtkToolkit [...] Caused by: > java.lang.UnsatisfiedLinkError: initIDs > > libgcj does this because it has its own native cni implementation and > doesn't use the classpath jni libraries. Except for... the gtk+ one. > > Have to think about the cleanest way to solve this. But reverting this > part of the import (attached) should get you going for now. You'll need > to configure with --enable-java-maintainer-mode (see the libjava/HACKING > file for more explanation). > > Cheers, > > Mark > Thank you Mark, that worked! Now AWT/Swing classpath examples are running fine compiled with gcj 4.4! Francesco