natClass.cc, java::lang::Class::initializeClass() problems
Marco Trudel
mtrudel@gmx.ch
Wed Dec 6 15:50:00 GMT 2006
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
More information about the Java
mailing list