Community
Participate
Working Groups
Build Identifier: 3.7.0 Build id: I20100921-1024 When I delete class files and/or directories from inside the output directory (as defined in project properties under Java Build Path->Source Tab->Default Output Folder) using the Finder then i get ClassNotFoundExceptions on running the application. I have Project->Build Automatically checked. I right click on the project under the Navigator and choose Refresh after deleting the files before launching the application. The refresh combined with build automatically should see the change and autobuild the missing classes but it does not. Sometimes even restarting Eclipse, repeated use of F5, etc make no difference. Changing the project properties does seem to force a rebuild but I should not have to play these games, Eclipse should realise after a refresh is applied. Reproducible: Always Steps to Reproduce: 1. Ensure Project->Build Automatically is checked 2. Delete class files from the classpath via the OS 3. Refresh project in navigator 4. Run the app via a run configuration 5. Get a ClassNotFoundException
This might be a duplicate of bug 325414. You could confirm this by trying refresh from Package Explorer view and see if it's working.
If the project is built and you remove the .class files from the output folder, then it is expected to fail. "Project->Build Automatically" is used only to make sure that the project is built before you run. The builder doesn't check that the .class files for all types in the project exist before starting a build. This would be too slow. The builder has a state for each project and if no changes have been done to the project, there is nothing to build. Why do you want to remove .class files from the output folder once the project is built ?
(In reply to comment #2) > If the project is built and you remove the .class files from the output folder, > then it is expected to fail. > "Project->Build Automatically" is used only to make sure that the project is > built before you run. > The builder doesn't check that the .class files for all types in the project > exist before starting a build. This would be too slow. The builder has a state > for each project and if no changes have been done to the project, there is > nothing to build. > Why do you want to remove .class files from the output folder once the project > is built ? Hello Olivier, Client uses multiple small projects and we import the source of those packages as a source dir. I wanted to edit one and get it to rebuild but sometimes the changes are not picked up. So I deleted the class files hoping that that would force a rebuild. I am obviously labouring under a mis-apprehension. Sometimes Eclipse is slow to notice changes in different parts of the UI. Occasionally it stubbornly refuses to notice changes even after multiple Refreshes or even restarting the app.
(In reply to comment #3) > Client uses multiple small projects and we import the source of those packages > as a source dir. I wanted to edit one and get it to rebuild but sometimes the > changes are not picked up. So I deleted the class files hoping that that would > force a rebuild. I am obviously labouring under a mis-apprehension. How do you do the import ? Are you using the import feature or you directly unzip from the OS? Did you try to refresh the project ? If you want to force a rebuild, use the clean/rebuild mechanism. This will force a rebuild of the whole project. As you entered this bug report, I will close it as INVALID as there is no way we want to support the case where .class files are removed after the project is built.
Closing as INVALID. Please reopen if you find a case where this happens without cleaning the output directory.
Verified for 3.7M3