• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compiler Error using Java's File class  RSS feed

 
Erica May
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys/gals,

I'm having some problems trying to validate some input - specifically I am trying to verify that a bunch of files exist, before I go opening them and reading them. To do this I'm using Java's File class, however my compiler is telling me that it "cannot find symbol - class File"

Here is my usage of it (note - this is embedded in a for loop and there is a bunch of other code, but my compiler is pointing at the first "File" on the first line here)



I have import java.io.*; as well as java.io.File.*; just in case, however I am still getting the same compiler error. It's driving me bonkers!

If anyone has any suggestions I would be very grateful.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a small program -- a SSCCE <= link -- that demonstrates the problem. Post the code here, and copy and paste any compiler error messages. Also TellTheDetails of exactly how you tried to compile the code.

import java.io.File.*; is meaningless.
 
Erica May
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Darryl,

I understand you must get this a lot, I will do as you suggested the next time I run into a problem.

When I was putting together my SSCCE I actually discovered the problem - I had misspelt java.io . After hours of looking at it, it now seems glaringly obvious.
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out, and welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!