I've seen occasional problems with Eclipse forgetting that built-in classes (including Object
and String
) exist. The way I've resolved them is to:
- On the Project menu, turn off "Build Automatically"
- Quit and restart Eclipse
- On the Project menu, choose "Clean…" and clean all projects
- Turn "Build Automatically" back on and let it rebuild everything.
This seems to make Eclipse forget whatever incorrect cached information it had about the available classes.