Search code examples
javaeclipsecorrupt

Recreating a project's "bin" folder in eclipse


My Portable hard drive was damaged recently, on which I had my Eclipse workspace, but during the (expensive) recovery process, it was partially recovered. I have most of my source, but it happens that a project's bin file is empty. It was probably damaged.

Now, I know that the bin file contains only .class files and I can probably regenerate them in a new project and move then to this bin. I may even be able to compile it via console and move it here, but since the project is big, is there any way to tell eclipse to recompile the classes and put them in the bin?

I already tried using Project > Clean. It doesn't seem to regenerate them.

Additional info :

  • The bin is empty. I cant see even the empty package folders there.
  • For one thing, I'm not sure if that is the problem at all. What I really get is an error saying "Error: Could not find or load main class ut.rm.reader". But I noticed that other projects having the .class files in the bin work fine. So I'm taking a good guess that this is the problem.

Thanks in advance.


Solution

  • These answers are really good and to the point. If they could not help you it is probably because your .project file is damaged. Try this:

    Close your project and remove from the workspace (delete the project but not the physical files).

    Delete the .project file, which is in the root of the project you just closed.

    Make a backup of your project (always a good idea)

    In Eclipse, create a new project and copy the files into the new project. Make sure it is a Java project.

    As soon as you rebuild the project you should see the bin folder.