-1

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.

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.

enter image description here

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.

vasu gupta
  • 305
  • 1
  • 3
  • 11
  • Look at this answer [Get file from project folder java](https://stackoverflow.com/questions/17287478/get-file-from-project-folder-java) – naif.ult Aug 05 '20 at 07:05
  • The `src` directory won't be there at runtime. You have the file in the wrong place. – user207421 Aug 05 '20 at 08:13

1 Answers1

0

The default working directory for Intellij is the root directory of the project.

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

psyjg47
  • 36
  • 1