views:

223

answers:

1

I wrote an application in the Eclipse, which was successfully compiled and run. After that, in a corresponding directory I found *.java and *.class files. Then I have deleted the *.class file and now I do not know how can I get it back.

Eclipse writes me "A class file was not written. The project may be inconsistent, if so try refreshing this project and building it".

By the right click on the project I got a drop down menu in which I found "Refresh" but I cannot find out how can I "build" the project.

So, how can I generate the class file again?

Thank you in advance for any help.

+3  A: 

Cleaning (Menu: Project -> Clean ...) the project should be enough to start the build. Check that automatic build (Project -> Build Automatically) is enabled. If automatic build is disabled use build all (Menu: Project -> Build All).

Thomas Jung
OK. But how can I "clean" the project?
Roman
If Build Automatically is disabled, the Clean dialog has an option (selected by default) to start a build after the clean anyway (at least in 3.4.x).
Ash
Ash, in my case the "Build Automatically" is not disabled. Should I disable it? Where can I find the clean dialog? How can I initiate the clean?
Roman
I found "Clean Up" in the "Source" menu. I clicked it and I did not get the desired *.class file.
Roman
"Clean..." is in the same "Project" menu as "Build Automatically".
Thomas Jung
Thanks, Thomas! Project->Clean worked well. Now I have the class-file.
Roman