I have a jar file, a.jar, which contains A.class and its manifest has Main-Class attribute set to A. A.class depends on B.class. B.class is packaged inside b.jar.
When I run 'java -classpath a.jar:b.jar A', it is able to find B.class.
When I run 'java -classpath b.jar -jar a.jar', it fails to find B.class as the following error shows:
Exception in thread "main" java.lang.NoClassDefFoundError: B
Both a.jar, b.jar and A.java & B.java are included in attachment testcase.zip.
I am using JDK 1.5. When I tested with 1.6.0-beta2-b72, I got the same result.