Posted by colindmoore
on September 20, 2003 at 8:15 AM PDT
I can open a text file in Linux without any problems. But when I try this on my Windows XP system I get the following error:
"Error - java.io.FileNotFoundException: testing.txt (The system cannot find the file specified)"
I know the file exists (that was the first thing I checked), and the file is not protected or anything like that. Could this be a Java Policy file problem? Any ideas on how I can fix this?
Here is my code:
public class FileIO
public static void main(String args)
System.out.println("About to read in C:\\testing.txt");
String text = null;
BufferedReader in = null;
in = new BufferedReader(new FileReader("C:\\testing.txt"));
while ( (text = in.readLine()) != null)
//text = in;
System.out.println("Done reading file");
catch (IOException e)
System.out.println("Error - " + e);
Any help or guidance is appreciated.