This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 47799

Summary: nested dependencies not added to runtime classpath
Product: projects Reporter: athompson <athompson>
Component: AntAssignee: Jesse Glick <jglick>
Status: CLOSED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description athompson 2004-08-24 14:45:43 UTC
1. create project 'a' and add class 'A':

package a;
public class A {
    public static void main(String[] args) {
        System.out.println("a!");
    }
}

2. create project 'b' and add 'a' as dependency
3. add class 'B':

package b;
public class B {
    public static void main(String[] args) {
        System.out.println("b!");
        a.A.main(args);
    }
}

3. create project 'c' and add 'b' as dependency
4. add class 'C':

package c;
public class C {
    public static void main(String[] args) {
        System.out.println("c!");
        b.B.main(args);
    }
}

5! try to run project 'c'. all compile ok but a
java.lang.NoClassDefFoundError is issued for
'a/A', because it was not added to the classpath.

i imagine for web applications, the nested
dependencies are not added to the lib directory,
although i haven't tested that.

if this is as designed, it needs to be reworded in
the project properties to state this more clearly
(i also disagree with it, especially because of
the webapp reason above).
Comment 1 Jesse Glick 2004-08-24 17:24:43 UTC
As designed, at least for 4.0; will adjust UI to hopefully make that
clearer. Just add A to C's r/t classpath explicitly (similarly for web
apps). A structured project type like Java Web Start would probably
not require this kind of manual adjustment since it would have a
first-class notion of containment.

*** This issue has been marked as a duplicate of 47507 ***
Comment 2 Marian Mirilovic 2005-07-12 10:17:04 UTC
closed