8

I have Java JDK 1.7.0_07 installed and I made sure that the Java build path in Eclipse is pointing to the right directory in my system. How come my machine complains of not having the 'File' object available? I have made sure i imported java.io.*. What could be wrong?

3
  • Does it know what Object or String are? And java.io is a package, not a library.
    – Dan D.
    Sep 1, 2012 at 10:28
  • would please provide your import code Sep 1, 2012 at 10:31
  • Okay, nvm I figured out the problem and it's quite stupid. I'm a newbie to this and thank you for your help.
    – tomato
    Sep 1, 2012 at 10:32

1 Answer 1

16

Just make sure the JRE System Library is part of your build path (see the picture below). Check that the System library is set and if not, click on Add library and select JRE System Library.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.