I don't know why Eclipse cannot recognize java.io library

I have Java JDK 1.7.0_07 installed, and I made sure that the Java build path in Eclipse points to the correct directory on my system. Why does my machine complain that you don’t have an available File object? I made sure to import java.io. *. What could be wrong?

+5
source share
1 answer

Just make sure the JRE system library is part of your build path (see image below). Make sure that the system library is installed, and if not, click "Add Library" and select "System Library JRE".

enter image description here

+13
source

All Articles