Using FileReader causes a compiler error “unhandled exception type FileNotFoundException”

后端 未结 6 1058
傲寒
傲寒 2021-01-15 10:01

Ive read a few threads here that relate the same problem, but the solutions arent working. :/

I use Eclipse, here is my program.

package mypackage;
         


        
6条回答
  •  耶瑟儿~
    2021-01-15 10:52

    Instead of trying to figure out what's going on, why not print what's going on...

    Make this change to your code:

    log(myfile.getName() + "(full path=" + myfile.getAbsolutePath() + ") does not exist");
    

    You might find it either isn't using the directory you think, or (depending on your filesystem) it might be trying to create a file whose name is literally "src/mypackage/myscript.abc" - ie a filename with embedded slashes.

提交回复
热议问题