This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
natClass.cc, java::lang::Class::initializeClass() problems
- From: Marco Trudel <mtrudel at gmx dot ch>
- To: GCJ <java at gcc dot gnu dot org>
- Date: Wed, 06 Dec 2006 16:50:30 +0100
- Subject: natClass.cc, java::lang::Class::initializeClass() problems
Hello all
I'm trying to use AWT/Swing from a Sun 1.4.2_13 JRE. I can successfully
compile a minimal AWT application with AWT/Swing from Sun instead of GNU
classpath. When running the compiled binary, I get:
Exception in thread "main" java.lang.NoClassDefFoundError:
sun.awt.windows.WComponentPeer
at
java.lang.Class.initializeClass(/foobar/GCC-source/libjava/java/lang/natClass.cc:719)
at java.awt.Component.initIDs(D:/foobar/sunGui.jar:0)
at
java.lang.Class.initializeClass(/foobar/GCC-source/libjava/java/lang/natClass.cc:750)
at
java.lang.Class.initializeClass(/foobar/GCC-source/libjava/java/lang/Class.h:651)
at
java.lang.Class.initializeClass(/foobar/GCC-source/libjava/java/lang/Class.h:651)
at
java.lang.Class.initializeClass(/foobar/GCC-source/libjava/java/lang/Class.h:651)
It looks like:
1. java.awt.Component is initialized
2. it calls initIDs which is a JNI method
3. initIDs tries to load WComponentPeer (which is in the binary) but
runs in a JV_STATE_ERROR in natClass.cc:719
I have no idea where to start with this. Can this be a problem of native
compilation (initializeClass called while in initializeClass)? Maybe a
problem with JNI? Am I missing some basic knowledge?
I have to mention that I'm trying this on mingw, not on Linux. GCJ
compiled binaries for Linux seem to have problems with stacktraces
during initialization for quite a while now. When an exception occur and
the binary is stripped, something like <<No Stacktrace available>>
appears. If the binary is created with debug data, it just prints "Aborted".
Hints? Ideas?
thanks
Marco