简体   繁体   English

系统找不到指定的路径(java eclipse)

[英]The system cannot find the path specified (java eclipse)

I'm not coing to copy paste all my code, but here's the line where I get the error : 我不想复制粘贴我的所有代码,但这里是我收到错误的行:

try {
    BufferedReader in = new BufferedReader(new FileReader(args[0]));
}

catch(IOException e) {
    System.out.println(e);
}

In the run configuration, I've set the argument as "file" (the name of my file which is simply a file type), but I always get this error : "The system cannot find the path specified". 在运行配置中,我将参数设置为“file”(我的文件名称只是一种文件类型),但我总是得到这个错误:“系统找不到指定的路径”。

My file is located in the src folder, and I already tried to put \\src\\file in my argument and it still didn't work. 我的文件位于src文件夹中,我已经尝试将\\ src \\ file放在我的参数中,但它仍然无效。 Is there any way to resolve this error? 有什么办法可以解决这个错误吗?

Thank you 谢谢

Place in Root Folder not src 放在根文件夹中不是src

ProjectRootDir
           my.txt
           src

If you're running from command line, you may need to place in the bin folder 如果从命令行运行,则可能需要放在bin文件夹中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM