views:

392

answers:

4

Hello

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? Thanks.

+1  A: 

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"

Chris Dolan
I tried the cleaning but it didn't help. I had to move the folder out from the bin dir and change its classpath var to the new location
KáGé
A: 

Problems with deleting things for me under Windows usually come down to one of two things:

  • The file being open by a program. This includes the JVM. This usually doesn't go away by itself.
  • The Antivirus-program on the computer has the file open for whatever it needs to do. This usually goes away after a while. I frequently recreate workspaces, and if this happens too fast, Eclipse complains that it cannot delete files.
Thorbjørn Ravn Andersen
I suppose it was the JVM for me
KáGé
A: 

I just had this issue ... and it was due to the fact that I had a command line session (DOS screen...) open in a folder in the BIN tree for the project I was building ... I wanted to run the .class file via command line.

Solution was simply to cd back to the bin folder so that the "clean" could remove and recreate those target folders.

Donald Klopper
A: 

This just happened to me. I had User Access Control (UAC) turned off when it happened (windows vista 32 bit). I turned UAC back on, rebooted vista and then the error went away. Counter intuitive that with UAC turned off, delete of the bin/net directory fails, but with UAC back on it works. Go figure.

Dan