I'm working on a project with Eclipse and by now everything was fine, but last time I've tried building it, it returned the error,
"The project was not built due to "Could not delete '/Torpedo/bin/bin'.". Fix the problem, then try refreshing this project and building it since it may be inconsistent Torpedo Unknown Java Problem"
And it deleted my bin folder which stores all the images and stuff needed for the program. (Fortunately I had a backup). I've tried googling it and tried every solution I found, but nothing helped, and also most of them suggests to delete the folder by hand, which I can't. What should I do?
Projects can be deleted within Eclipse. Just select the project and choose delete. If you want to completely remove it from your harddisk you have to select "Delete project contents on disk" in the appearing dialogue.
To delete a project, right-click on the project in the Package Explorer. Again, select “Delete” from the context menu. To delete your project select the option “Also delete contents under…” and select “Yes.”
Make sure the “Do not delete contents” radio button is selected, and then click Yes to remove the project from Eclipse. The project will disappear from the Package Explorer.
It is possible that the folder is locked and you are unable to delete it. Restarting the computer will release the lock and you can delete it then. If you replace the bin folder by a bin file, the culprit may show up.
I see this semi-regularly on Windows. I think it's a bug or race in Eclipse, maybe a race with a virus checker which doesn't like a delete immediately followed by a write to the same file that was deleted. The fix I use is to use Project -- Clean from the menu bar.
@Ash is right in the comments above that you should not have resources in your output folder. To help avoid that, I always change the name of my output folder from "bin" to something more obvious like "eclipse/classes"
I have this problem semi-regularly, particularly when deploying to Tomcat or such like, under Windows 7. It also happens to me with the command line version of maven as well, so it's not just Eclipse that has this problem.
The root cause is that something is holding onto a file handle. Most of the problems went away when I disabled windows search/indexing on my PC, but the problems sometimes still occur.
To track down what is going on, you need to download Process Explorer (one of the most useful programs that I have ever come across). This allows you to see exactly what is running on your PC, the files it has open, the performance of the processes, how much cpu it's running, the amount of IO it's doing etc. When you have a file that can't be deleted, you can Find->Find Handle or DLL, and enter part of the name, and it gives you who has it open. You don't always catch it in time, but often enough to know the culprit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With