Hele
Hele

Reputation: 1588

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 :

Thanks in advance.

Upvotes: 2

Views: 15222

Answers (4)

Chris Hagn
Chris Hagn

Reputation: 21

This may not be an issue with the current project but a project you are dependent on.
Right click on your project and Select: Build Path > Configure Build Path

Under the projects tab, check to see if any other projects are listed. You may need to resolve the Java Compiler settings or libraries in that project. If there is an issue with that project, there should be a "red exclamation" mark on that project.

Make sure that your JRE environment is compatible with the external JAR files and dependent projects.

Upvotes: 0

pebble
pebble

Reputation: 341

Delete bin folder.

Right Click on Project's Name and choose "Refresh" which will generate (empty)directory structure.

Run the project(Click on Play symbol).

Upvotes: 0

Alexandre Santos
Alexandre Santos

Reputation: 8338

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.

Upvotes: 6

Chris Gerken
Chris Gerken

Reputation: 16400

This is a bit of a kludge, but go to the compiler settings for the project (configure build path) and make a change (e.g. change one of the Java Compiler -> Errors/Warnings from warning to error). When you click apply you'll be told you need to recompile the entire project. Once the project is recompiled (and your classes recreated), go back and undo the compiler setting you changed.

Upvotes: 1

Related Questions