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

package test;

import test2.Test2;

/**
 * Test1.java
 *
 *
 * Created: Sat Feb  7 11:50:54 2004
 *
 * @author <a href="mailto:[EMAIL PROTECTED]">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
package test2;

import test3.Test3;

/**
 * Test2.java
 *
 *
 * Created: Sat Feb  7 11:51:48 2004
 *
 * @author <a href="mailto:[EMAIL PROTECTED]">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
package test3;

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

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

} // Test3
Manifest-Version: 2.0
Main-Class: test.Test1
Class-Path: test2.jar 
Manifest-Version: 2.0
Class-Path: test3.jar

Attachment: test1.jar
Description: application/java-archive

Attachment: test2.jar
Description: application/java-archive

Attachment: test3.jar
Description: application/java-archive

Reply via email to