转自: https://stackoverflow.com/questions/21778922/eclipse-false-error-with-jdk7
You can solve this by setting up correct JRE environment in Eclipse as below.
- Go to
Project=>Properties=>Java Build Path - Click on
Libraries - Select
JRE System Library - Click on Edit button at right hand side
- Set
Execution EnvironmenttoJave SE-1.7(jre7) - Clean project or refresh project.