简体   繁体   English

src 文件夹中文件的 intellij 中的 FileNotFoundException 错误

[英]FileNotFoundException error in intellij for a file in src folder

I was working on a project which was working fine till yesterday.我正在从事一个项目,该项目直到昨天都运行良好。 I don't know if I changed some setting or what but now its not reading files in the src folder.我不知道我是否更改了某些设置或什么,但现在它没有读取 src 文件夹中的文件。

I made a new demo project just to check if the problem exist in my code of IDE setting for reading a test file and printing it buit eventhat is giving the same error.我制作了一个新的演示项目,只是为了检查我的 IDE 设置的代码中是否存在问题,以读取测试文件并打印它,即使它给出了相同的错误。

在此处输入图像描述

As you can see members.txt exist in the src folder as I said.Moreover when I hoverover member.txt in code it is giving me the full details of file like abs path, size and all, which tells that atlease IDE is able to access the file as well.正如我所说的,src 文件夹中存在 members.txt。此外,当我在代码中将鼠标悬停在 member.txt 上时,它会为我提供文件的完整详细信息,如 abs 路径、大小等,这表明 atlease IDE 能够也可以访问该文件。

The default working directory for Intellij is the root directory of the project. Intellij 的默认工作目录是项目的根目录。

You can change this in the build / run configuration, add 'src/' to the file path you use to create the Scanner or move the file into the root directory您可以在构建/运行配置中更改此设置,将“src/”添加到您用于创建扫描仪的文件路径或将文件移动到根目录

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

相关问题 始终接收FileNotFoundException,即使SRC文件夹中有文件也是如此 - Always receiving FileNotFoundException, even with file in SRC folder java.io.FileNotFoundException无法找到src文件夹下的文件 - java.io.FileNotFoundException cannot locate file under src folder IntelliJ“FileNotFoundException”,文件存在 - IntelliJ “FileNotFoundException”, File Exists IntelliJ IDEA文件FileNotFoundException,目录和文件是否存在? - IntelliJ IDEA File FileNotFoundException, directory and file exists? IntelliJ不允许我运行我的Java代码,将文件上传到git repo后,src文件夹不是蓝色 - IntelliJ is not letting me run my Java code, src folder is not blue after uploading file to git repo 文件存在于与程序相同的文件夹中的FileNotFoundException - FileNotFoundException while file exists in same folder as program 读取资源文件夹中的文件时出现 FileNotFoundException - FileNotFoundException when reading file in resources folder 错误原因:SpringBoot 2.0 应用程序中 src/main/resources/config/env/dev2 下的文件的 java.io.FileNotFoundException - Error Caused by: java.io.FileNotFoundException for file under src/main/resources/config/env/dev2 in SpringBoot 2.0 application JasperPrint FileNotFoundException 但文件显示错误 - JasperPrint FileNotFoundException but file IS shown on error 蚂蚁:带有src文件夹的Jar文件 - Ant: Jar File with src folder in it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM