user316117
user316117

Reputation: 8281

Saving workspaces in Eclipse - behavior doesn't match the docs

In a big old, Android project, this morning I added a new activity class and a new XML layout file. A little while later I started getting some weird build errors so I decided to shut down Eclipse to restart it (because that often fixes weird Eclipse problems). But Eclipse failed to shut down and hung saving the workspace. I had to kill javaw to get it to die. See Eclipse leaving stuff behind that I can't kill for details.

When I reopened it I discovered that my new files were no longer in the project! The files still existed on the disk. So I looked up how to save the workspace explicitly in the Eclipse wiki and it said . . .

Note that the most essential information in the workspace—such as newly created files and folders within Eclipse—are always stored on disk immediately. Saving the workspace simply involves storing away metadata, such as markers, and its in-memory picture of the projects. The workspace is designed so that if a user pulls the computer power cord from the wall at any moment, the resource tree will still be in a good state so that the workspace will be able to restart in a consistent state with minimal loss of information.

... obviously this wasn't true this morning so how do I prevent a repeat of this problem?

Upvotes: 1

Views: 34

Answers (1)

greg-449
greg-449

Reputation: 111217

The files are saved immediately but the metadata contains the information about which files are in the workspace. If the close fails this may be lost. The files are still there but Eclipse does not know about them.

Using 'File > Refresh' (with nothing selected) will refresh all the information about the files in the workspace.

Upvotes: 2

Related Questions