Eclipse: "The import java.io cannot be resolved"
Check two things
Eclipse preferences
- Check your Eclipse preferences:
Java
->Installed JREs
- The one that you're using should be marked and it should be a JDK not just a JRE.
Project build path
- Also check your project's build path: Right click on the project ->
Properties
->Java Build Path
- Check in the
libraries
folder whether the JRE System Library is present and ... - If not add it using
Add library
->JRE System Library
and then select the correct one (from an installed JDK).
I am using Maven an this is what I did to re-solve -->
- Right click on project
- Maven -> Update Project. Make sure you choose 'Force update of Snapshots/Releases'.
- Also check the 'clean project', 'update project conf from pom' and 'refresh workspace resource options' and click ok.