This means the version of a project facet does not match the version of the compiler. I was getting this error on Eclipse Mars. I did the following to fix this:
- Open the project properties.
- Select “Project Facet” from the left pane.
3. Click on the version beside “Java” facet. Select the one that matches your compiler version.
For me it was Java 7, so I selected 1.7.
That’s it. The error was gone.