Reprinted: http://blog.csdn.net/lotusyangjun/article/details/5611352
This is a problem where the file system is not synchronized because the resource in the project is modified outside eclipse. However, sometimes similar errors are reported if the resource is not modified outside eclipse.
Solution: manually refresh the resource manager.
(1) In eclipse, right-click the project directory and select F5 (refresh)
(2) Set eclipse to automatically refresh.
Use Window> preferences> General> workspace to select refresh automatically
The project in eclipse cannot view the source file. The error "resource is out of sync with the file system" is returned. The only problem was that the source file was modified outside of the eclipse project but not refreshed. Myeclipse help documentation:
Don't forget to refresh!
Whenever you use external tools to modify workspace files, you must perform a refresh from within eclipse to make the workspace aware of the changes. if you get a resource out of sync error in eclipse it is a sign that there are resources in eclipse that have
Been Modified outside of Eclipse.
One solution is to perform a refresh (available from a resource's popup menu) on any resources or projects that where modified outside of Eclipse.
There is also a preference to refresh automatically. But setting it to auto refresh is a little expensive in the age of great projects! Window-> preferences-> General-> workspace, select refresh automatically.