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.
Three similar issues. When any of the following changes are made through the IDE: 1. Library (Jar) file changes 2. Java source file delete 3. Java source file rename The build directory is left erroneous, often without the programmer knowing what is going on. This often leads to hours of unnecessary work to discover the problem. This is something the IDE can handle trivially. For example, let's say you have a huge project with 15K classes. You rename one of the Java files. NetBeans compiles the renamed Java file into an associated class file in the build directory but leaves the old class file there! Also, let's say you change the library files you use (JAR files) or change their order, NetBeans doesn't update the build directory causing the old JAR files to be loaded very unexpectedly. Same thing with Java file deletes. I know a clean & rebuild fixes the problem but on large projects this is rarely done. The IDE does so much automatically, it is unexpected that it would correctly handle such simple cases. NetBeans should: 1. Delete all the JAr files from the build directory whenever a library change is made through the IDE. This way the next time the app is started or built, the new libraries will be copied (without leaving copies of the old ones). 2. Whenever a source file is renamed, the compiled version with the old name should be deleted from the build path. This way the new one will be compiled without leaving the old one unexpectedly present. 3. Whenever a source file is deleted, the compiled version in the build directory should be deleted too. Since each of these three operations occurs from within NetBeans, NetBeans knows what is happening and what logically needs to be done yet it isn't doing it. This can cause an unsuspecting programmer many hours of unnecessary work.
Please which project are you using (J2SE Application, Maven, Web application). The clean up is project specific and also affected by the Compile Os Save feature. Is Compile On Save enabled? Thanks!
The app I have is a Web Service / Tomcat application. Please read the following: The problem is not with the 'clean' or the 'clean & rebuild' feature of NetBeans. The problem is when you perform one of the three functions I indicate and then try to 'build' or 'run' it without a 'clean'. I explain it in my text. I happen to have 'Compile on Save' off but that wouldn't matter at all.
>The problem is not with the 'clean' or the 'clean & rebuild' feature of NetBeans. Yes, the clean clears all files in build. >I happen to have 'Compile on Save' off but that wouldn't matter at all. In the Java Application Project (Compile On Save Enabled) the class file for renamed (deleted) file is removed. When Compile On Save is Disabled the class file remains. However the Compile On Save on Web Project may behave differently as it's web project specific.
While it is good that NetBeans gives you a choice on whether or not to compile or not on save, in either case the actions I describe should occur. So, the change is unrelated to that setting.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss