java.io.FileNotFoundException: the system cannot find the file specified

前端 未结 8 1569
Happy的楠姐
Happy的楠姐 2020-11-22 15:27

I have a file named \"word.txt\".

It is in the same directory as my java file.

But when I try to access it in the following code th

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 16:00

    Make sure when you create a txt file you don't type in the name "name.txt", just type in "name". If you type "name.txt" Eclipse will see it as "name.txt.txt". This solved it for me. Also save the file in the src folder, not the folder were the .java resides, one folder up.

提交回复
热议问题