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.
Product Version = NetBeans IDE 4.1 (Build 200505031930) Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.5.0_03; Java HotSpot(TM) Client VM 1.5.0_03-b07; Sun Microsystems Inc. Java Home = C:\Program Files\Java\jdk1.5.0_03\jre System Locale; Encod. = sl_SI (nb); Cp1250 observed behavior: classloader doesn't load classes in right order expected behavior: classloader should load classes from build directory first before loading from library exact steps to reproduce the problem: 1. new project Java Main class: test.bug.Main 2. create Java Class bug.report.Henry 3. create Java Class bug.report.Peter extends Henry 4. compile both java classes 5. make dir bugLib and copy classes and src from project into dir 6. make library to bugLib 7. refactor class Henry ... add private class member private String surname = "Fonda"; 8. refactor class Henry ... ad protected method protected String getSurname() { return surname; } 9. create Java Class bug.report.Bridget extends Peter 10. add public method in Bridget class: public void tellSomething() { System.out.println("my grandpa was "+getSurname()); } 11. refactor class test.bug.Main main method: public static void main(String[] args) { Bridget bridget = new Bridget(); bridget.tellSomething(); } 11. when i run project i get: Exception in thread "main" java.lang.NoSuchMethodError: bug.report.Bridget.getSurname()Ljava/lang/String; But when I run from MS-DOS command program executes properly: java -cp D:\javaFiles\bug\build\classes;D:\bugLib\classes test.bug.Main my grandpa was Fonda
Created attachment 23287 [details] netbeans project & bugLib directory
Seems like a java/j2seproject issue. Reassigning...
The classpath is passed in the same order as specified in project customizer. But it is good practise to have libraries before the dist.jar. But if you need to override classes in the library you can change the order in the project's customizer.