This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Have you created a class called File that is in the same folder, or some other folder on your classpath?
Because it CAN find a File class, but then doesn't recognize methods and a constructor that are very much part of the java.io.File class. Therefore, it looks like it uses some other class also called File. Since it isn't imported, the only other possibility would be that that class is in the same package - in this case the default package.