[kaffe] kaffe -jar should recursively set meta-inf/manifest.mf#Class-Path

Arnaud Vandyck arnaud.vandyck@ulg.ac.be
Sat Feb 7 14:33:02 2004


--=-=-=

Hi all,

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

$ kaffe -jar test1.jar

great
java.lang.NoClassDefFoundError: test3/Test3
   at test2.Test2.print2 (Test2.java:26)
   at test.Test1.main (Test1.java:23)
   at java.lang.reflect.Method.invoke0 (Method.java)
   at java.lang.reflect.Method.invoke (Method.java:255)
   at kaffe.jar.ExecJarName.main (ExecJarName.java:67)
   at kaffe.jar.ExecJar.main (ExecJar.java:75)

The classes and manifest files and jar files are attached.

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,

-- 
Arnaud


--=-=-=
Content-Type: text/x-java
Content-Disposition: attachment; filename=Test1.java

package test;

import test2.Test2;

/**
 * Test1.java
 *
 *
 * Created: Sat Feb  7 11:50:54 2004
 *
 * @author <a href="mailto:arnaud@localhost">Arnaud Vandyck</a>
 * @version 1.0
 */

public class Test1{
  public Test1() {
    
  }
  
  public static void main(String[] args) {
    Test2 tt = new Test2();
    System.out.println(tt.print());
    System.out.println(tt.print2());
    
  }
} // Test1

--=-=-=
Content-Type: text/x-java
Content-Disposition: attachment; filename=Test2.java

package test2;

import test3.Test3;

/**
 * Test2.java
 *
 *
 * Created: Sat Feb  7 11:51:48 2004
 *
 * @author <a href="mailto:arnaud@localhost">Arnaud Vandyck</a>
 * @version 1.0
 */
public class Test2 {
  public Test2() {
    
  } // Test2 constructor

  public String print()
  {
    return "great";
  }

  public String print2()
  {
    Test3 tt = new Test3();
    return tt.print();
  }
  
} // Test2

--=-=-=
Content-Type: text/x-java
Content-Disposition: attachment; filename=Test3.java

package test3;

/**
 * Test3.java
 *
 *
 * Created: Sat Feb  7 11:51:48 2004
 *
 * @author <a href="mailto:arnaud@localhost">Arnaud Vandyck</a>
 * @version 1.0
 */
public class Test3 {
  public Test3() {
    
  } // Test3 constructor

  public String print()
  {
    return "great";
  }

} // Test3

--=-=-=
Content-Disposition: attachment; filename=manifest.test1

Manifest-Version: 2.0
Main-Class: test.Test1
Class-Path: test2.jar 

--=-=-=
Content-Disposition: attachment; filename=manifest.test2

Manifest-Version: 2.0
Class-Path: test3.jar


--=-=-=
Content-Type: application/x-java-archive
Content-Disposition: attachment; filename=test1.jar
Content-Transfer-Encoding: base64

UEsDBBQACAAIACphRzAAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAAMAUEsHCAAAAAACAAAA
AAAAAFBLAwQUAAgACAAqYUcwAAAAAAAAAAAAAAAAFAAAAE1FVEEtSU5GL01BTklGRVNULk1G803M
y0xLLS7RDUstKs7Mz7NSMNIz4OVyzkksLtYNSCzJsFIoAUob6WUlFikAxYtSE0tSU3SdKq0UDPVM
9AwVNDydfBWc84sK8osSS4AGaPJy+SZm5umCTYBo1gsBEoa8XLxcAFBLBwhWQhbGZAAAAG4AAABQ
SwMECgAAAAAAKWFHMAAAAAAAAAAAAAAAAAUAAAB0ZXN0L1BLAwQUAAgACAApYUcwAAAAAAAAAAAA
AAAAEAAAAHRlc3QvVGVzdDEuY2xhc3NtUFtLAkEU/sbb5LilqatZWtkF1oKWfDWCCHqSChQhelpt
kJG9hK5BP6seFAr6Af2o6MwaSNQ8nMuc73zfOefz6+0DgI1DjhiDCOUktLtkTjkSDLmR8+TYruMP
7Zv+SA5ChoTnKJ+hZN23l8VOOFb+sNXoUf0yeJAM2bby5fXU68tx1+m7kkMwZDR9M+JvGjCwypA6
U74KzxniVqMnkEbGQA7rlAdTUjMXIiqwb0khJB3peK00CshyFH8N2HmehNIzUEKZIfmo4QxFq/F3
TC1jGtjEFgOPgC5tZFr/LSRQQ4Vjm6HwzyQGdrVaKiJpat4dgTgydMlOMB0P5JVy6RgiuuiJJkAd
tBv0ixE8iRTlnLILymPka+9I382x1n5F/niGjRmqi6hO0QsBGFbI5pEga1JcoriMKipUoZP+0GkZ
Rj55NMfesk1EGjlqztPPfjTFwTdQSwcIGfTDVVMBAAAFAgAAUEsBAhQAFAAIAAgAKmFHMAAAAAAC
AAAAAAAAAAkABAAAAAAAAAAAAAAAAAAAAE1FVEEtSU5GL/7KAABQSwECFAAUAAgACAAqYUcwVkIW
xmQAAABuAAAAFAAAAAAAAAAAAAAAAAA9AAAATUVUQS1JTkYvTUFOSUZFU1QuTUZQSwECCgAKAAAA
AAApYUcwAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAADjAAAAdGVzdC9QSwECFAAUAAgACAApYUcw
GfTDVVMBAAAFAgAAEAAAAAAAAAAAAAAAAAAGAQAAdGVzdC9UZXN0MS5jbGFzc1BLBQYAAAAABAAE
AO4AAACXAgAAAAA=
--=-=-=
Content-Type: application/x-java-archive
Content-Disposition: attachment; filename=test2.jar
Content-Transfer-Encoding: base64

UEsDBBQACAAIAEphRzAAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAAMAUEsHCAAAAAACAAAA
AAAAAFBLAwQUAAgACABKYUcwAAAAAAAAAAAAAAAAFAAAAE1FVEEtSU5GL01BTklGRVNULk1G803M
y0xLLS7RDUstKs7Mz7NSMNIz4OVyzkksLtYNSCzJsFIoAUob62UlFgGFi1ITS1JTdJ0qrRQM9Uz0
DBU0PJ18FZzziwryixJLgPo1ebl4uQBQSwcIiDKMglMAAABVAAAAUEsDBAoAAAAAAEphRzAAAAAA
AAAAAAAAAAAGAAAAdGVzdDIvUEsDBBQACAAIAEphRzAAAAAAAAAAAAAAAAARAAAAdGVzdDIvVGVz
dDIuY2xhc3NdTk1Lw0AUnM1n3aZNW1sFPfXWKBiwR8WL4CnooUXwmNQlpMRUYtrfpRcLCv4Af5Q4
G4IFd2He7LydN+/75+MLQIhDF4ZAu1Iv1Xk41+jCEugt400c5nGRhnfJUi0qAfu5zArW4SSIdt1Z
RTW9ELCuV49KwI+yQt2unxJVzuMkVy1IWtNSxbQ69QgmdJrIaR059eCjx/ZlVmTVlYA5Ce4lPHQ9
2HA0G0iY6ArI2WpdLtRNljNL1vue6WUwBm3QxySji+jydcwqtDrYe2URaBGdWhoR238fAxi8QOcT
3sMW/ej0Hfs7i6ybR+R6ItdtbONmvn2yxfDt33cfFvpURuQGDn4BUEsHCLfmf6ADAQAAdQEAAFBL
AQIUABQACAAIAEphRzAAAAAAAgAAAAAAAAAJAAQAAAAAAAAAAAAAAAAAAABNRVRBLUlORi/+ygAA
UEsBAhQAFAAIAAgASmFHMIgyjIJTAAAAVQAAABQAAAAAAAAAAAAAAAAAPQAAAE1FVEEtSU5GL01B
TklGRVNULk1GUEsBAgoACgAAAAAASmFHMAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAA0gAAAHRl
c3QyL1BLAQIUABQACAAIAEphRzC35n+gAwEAAHUBAAARAAAAAAAAAAAAAAAAAPYAAAB0ZXN0Mi9U
ZXN0Mi5jbGFzc1BLBQYAAAAABAAEAPAAAAA4AgAAAAA=
--=-=-=
Content-Type: application/x-java-archive
Content-Disposition: attachment; filename=test3.jar
Content-Transfer-Encoding: base64

UEsDBBQACAAIAG1fRzAAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAAMAUEsHCAAAAAACAAAA
AAAAAFBLAwQUAAgACABtX0cwAAAAAAAAAAAAAAAAFAAAAE1FVEEtSU5GL01BTklGRVNULk1G803M
y0xLLS7RDUstKs7Mz7NSMNQz4OVyLkpNLElN0XWqBAmY6BkqaHg6+So45xcV5BcllgAVavJy8XIB
AFBLBwg37y60PQAAAD4AAABQSwMECgAAAAAAFl9HMAAAAAAAAAAAAAAAAAYAAAB0ZXN0My9QSwME
FAAIAAgAL19HMAAAAAAAAAAAAAAAABEAAAB0ZXN0My9UZXN0My5jbGFzc0VOO08CQRicj3vh8jge
dlZ0YOEVlhoaEyqiBYR+DzeXJedBzsXfJRWJhT/AH0WcuxD4ipnd+WZm9+/08wsgQT9CQ9By5tM9
JssKI/iC3kZ/6STXRZa8pRuzdoJgV9qCfDuezK/bhaOaPQn8l+27EcRzW5jX/UdqyqVOc9OEYjQr
jWY0fLaFdVOBN56s2mihreChI1CL7b5cm5nNWaHqbzxUb2AEmlFNg6cAITHi7Y4sZG9w800SNIlh
LQ2JbD4bR2djcH9E93CxKvYBHfiIqcR1f+8fUEsHCIRJjbDUAAAAFQEAAFBLAQIUABQACAAIAG1f
RzAAAAAAAgAAAAAAAAAJAAQAAAAAAAAAAAAAAAAAAABNRVRBLUlORi/+ygAAUEsBAhQAFAAIAAgA
bV9HMDfvLrQ9AAAAPgAAABQAAAAAAAAAAAAAAAAAPQAAAE1FVEEtSU5GL01BTklGRVNULk1GUEsB
AgoACgAAAAAAFl9HMAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAvAAAAHRlc3QzL1BLAQIUABQA
CAAIAC9fRzCESY2w1AAAABUBAAARAAAAAAAAAAAAAAAAAOAAAAB0ZXN0My9UZXN0My5jbGFzc1BL
BQYAAAAABAAEAPAAAADzAQAAAAA=
--=-=-=--