Rafael Lopez
2006-10-11 05:55:10 UTC
Hello,
I have the following problem with qtjava: on my suse 10.0 (and 10.1), using
the suse packages, I can get my own programs to compile fine with gcj and
then run. However, on mandriva 2007.0, using the source rpm for kdebindings,
then building them, then installing them to have qtjava.jar, it just fails
to link (if I try to compile and link) or compiles without errors but fails
to run (both with gcj and javac/java).
The code used to test is the one on
http://www.valdyas.org/fading/index.cgi/hacking/gcj.html
Logs are below:
Compiles with gcj but won't run:
[***@localhost ~]$ export CLASSPATH=/usr/lib64/java/qtjava.jar
[***@localhost ~]$ gcj -C -classpath ${CLASSPATH} Hello.java
[***@localhost ~]$ gij -classpath ${CLASSPATH} Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
at gnu.java.lang.MainThread.run(libgcj.so.7)
Caused by: java.lang.ClassNotFoundException: Hello not found in
gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/lib64/java/qtjava.jar],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.Class.forName(libgcj.so.7)
at gnu.java.lang.MainThread.run(libgcj.so.7)
[***@localhost ~]$
Compiles with javac (1.5.0-8) but won't run:
[***@localhost ~]$ javac -cp ${CLASSPATH} Hello.java
[***@localhost ~]$ java Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
[***@localhost ~]$
Won't compile+link (gcj):
[***@localhost ~]$ gcj -fjni -classpath ${CLASSPATH}
/usr/lib64/java/qtjava.jar Hello.java --main=Hello -o hello
org/kde/qt/Invocation.java: In class 'org.kde.qt.Invocation':
org/kde/qt/Invocation.java: In method
'org.kde.qt.Invocation.fromQtTypeSignature(java.lang.String)':
org/kde/qt/Invocation.java:43: error: verification failed at PC=199: String,
int, or float constant expected
org/kde/qt/Invocation.java:43: error: verification failed at PC=205:
incompatible type on stack
org/kde/qt/Invocation.java:43: error: verification failed at PC=219: String,
int, or float constant expected
org/kde/qt/Invocation.java:43: error: verification failed at PC=225:
incompatible type on stack
org/kde/qt/Invocation.java:66: error: expected type 'java.lang.Object' but
stack contains 'int'
org/kde/qt/Invocation.java:68: error: expected type 'java.lang.Object' but
stack contains 'byte'
org/kde/qt/Invocation.java:66: confused by earlier errors, bailing out
[***@localhost ~]$
RL
I have the following problem with qtjava: on my suse 10.0 (and 10.1), using
the suse packages, I can get my own programs to compile fine with gcj and
then run. However, on mandriva 2007.0, using the source rpm for kdebindings,
then building them, then installing them to have qtjava.jar, it just fails
to link (if I try to compile and link) or compiles without errors but fails
to run (both with gcj and javac/java).
The code used to test is the one on
http://www.valdyas.org/fading/index.cgi/hacking/gcj.html
Logs are below:
Compiles with gcj but won't run:
[***@localhost ~]$ export CLASSPATH=/usr/lib64/java/qtjava.jar
[***@localhost ~]$ gcj -C -classpath ${CLASSPATH} Hello.java
[***@localhost ~]$ gij -classpath ${CLASSPATH} Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
at gnu.java.lang.MainThread.run(libgcj.so.7)
Caused by: java.lang.ClassNotFoundException: Hello not found in
gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/lib64/java/qtjava.jar],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.Class.forName(libgcj.so.7)
at gnu.java.lang.MainThread.run(libgcj.so.7)
[***@localhost ~]$
Compiles with javac (1.5.0-8) but won't run:
[***@localhost ~]$ javac -cp ${CLASSPATH} Hello.java
[***@localhost ~]$ java Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
[***@localhost ~]$
Won't compile+link (gcj):
[***@localhost ~]$ gcj -fjni -classpath ${CLASSPATH}
/usr/lib64/java/qtjava.jar Hello.java --main=Hello -o hello
org/kde/qt/Invocation.java: In class 'org.kde.qt.Invocation':
org/kde/qt/Invocation.java: In method
'org.kde.qt.Invocation.fromQtTypeSignature(java.lang.String)':
org/kde/qt/Invocation.java:43: error: verification failed at PC=199: String,
int, or float constant expected
org/kde/qt/Invocation.java:43: error: verification failed at PC=205:
incompatible type on stack
org/kde/qt/Invocation.java:43: error: verification failed at PC=219: String,
int, or float constant expected
org/kde/qt/Invocation.java:43: error: verification failed at PC=225:
incompatible type on stack
org/kde/qt/Invocation.java:66: error: expected type 'java.lang.Object' but
stack contains 'int'
org/kde/qt/Invocation.java:68: error: expected type 'java.lang.Object' but
stack contains 'byte'
org/kde/qt/Invocation.java:66: confused by earlier errors, bailing out
[***@localhost ~]$
RL