aspose file tools*
The moose likes Beginning Java and the fly likes Unusual FileNotFoundException error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unusual FileNotFoundException error" Watch "Unusual FileNotFoundException error" New topic
Author

Unusual FileNotFoundException error

Olivier Legat
Ranch Hand

Joined: Nov 17, 2007
Posts: 176



Hello everyone,

I've never used the FileReader class before and I keep getting a FileNotFoundException error at "FileReader fr = new FileReader("test.txt");" even though the file exists. I've tried it by giving the entire filepath and I've tried using several IDEs (since the results can vary from one to another) but I always get the same message. I was thinking it might be an OS problem (I'm with Vista), but it might be a simpler problem. Does anyone have any suggestions?

Thanks


Olly
Vladislav Mkrtychev
Greenhorn

Joined: Nov 29, 2008
Posts: 8
Your code works for me...
I get the output of a test.txt.
Olivier Legat
Ranch Hand

Joined: Nov 17, 2007
Posts: 176

Oh no!!! I had named my file "test.txt.txt". There's a setting in Windows that hides file extensions, and I forgot that it was enabled.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unusual FileNotFoundException error
 
Similar Threads
How To Read A Web Page
Euler's Triangle number program.
Help reading File
FileIO
Scanner class