[Bug java/14070] New: -jar argument should set the manifest Class-path recursively
avdyk at debian dot org
gcc-bugzilla@gcc.gnu.org
Sat Feb 7 23:12:00 GMT 2004
I was trying something (to prepare my talk with Dalibor at the FOSDEM;))
and the way IBM's JDK (1.4.1) does it is perfect for me!.. But kaffe
does not do it the same way.
$ java -jar test1.jar
great
great
$ gij -jar test1.jar
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving
class: test.Test1
at java.lang.ClassLoader.resolveClass0(java.lang.Class)
(/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.4.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.4.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean)
(/usr/lib/libgcj.so.4.0.0)
at __libc_start_main (/lib/libc-2.3.2.so)
Caused by: java.lang.ClassNotFoundException: test2.Test2 not found in
[file:test1.jar, core:/]
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String)
(/usr/lib/libgcj.so.4.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/lib/libgcj.so.4.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.4.0.0)
at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.4.0.0)
at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.4.0.0)
at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.4.0.0)
at java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.4.0.0)
at java.lang.ClassLoader.resolveClass0(java.lang.Class)
(/usr/lib/libgcj.so.4.0.0)
...7 more
What was I trying to do?
You probably know that you can specify a classpath in a manifest
file. If you run java with -jar theapplication.jar, java will search for
Main-Class field to execute the class and also to the Class-Path field
to 'dynamically' set the classpath.
I was wondering if a jar depends of a jar that depends of another, what
happens? With IBM runtime, if the second library has a correct
Class-Path field in its manifest file, then, the dependency is
resolved. But in kaffe, it's not the case.
Would it be possible to change the behavior of kaffe to make it resolve
the classpath with the -jar argument recursively?
I hope the explanation was correct...
Many thanks for your attention and time, cheers,
You can have the files I did use to make the test here:
http://www.kaffe.org/pipermail/kaffe/2004-February/045189.html
--
Summary: -jar argument should set the manifest Class-path
recursively
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P1
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: avdyk at debian dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14070
More information about the Gcc-bugs
mailing list