ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Cody <paul.c...@lucida.com>
Subject RE: Using Main-Class and Class-Path in a manifest file
Date Wed, 13 Mar 2002 00:09:47 GMT
> 
> As you suspect, the CLASS-Path in a jar's manifest is used to 
> find other
> jars relative to your jar, not jars within your jar
> 
> Conor
> 

This appears to be true:

$ cat > A.java
public class A {
    public static void main(String[] args) {
        B b = new B();
        System.out.println(b);
    }
}

$ cat > B.java
public class B {
    public String toString() {
        return "B";
    }
}

$ cat > manifest.mf
Manifest-Version: 1.0
Class-Path: b.jar
Main-Class: A

$ jikes A.java B.java
$ jar cvf b.jar B.class
$ jar cvfm a.jar manifest.mf A.class b.jar
$ rm A.class B.class b.jar
$ java -jar a.jar
Exception in thread "main" java.lang.NoClassDefFoundError: B
      at A.main(A.java:7)
 
Paul

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message