Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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
FileIO
Help reading File
Euler's Triangle number program.
How To Read A Web Page
Scanner class