if you specify the path to the file

E:\\IdeaProjects\\MyProject\\01\\src\\main\\java\\org\\Council\\test.txt 

The idea sees the file, and in this version:

 src/main/java/org/Council/test.txt 

does not work

And on another PC, an option indicating the relative path (last) works (one project).

tried to do Copy Relative Path - pasted the copied path, useless

Where in the settings IDEAS can be set?

File - Project Structure - Modules tried, to no avail

tried to put the file side by side, in the same directory, also does not work. Search tips did not help

  • depends on where the project started from - Senior Pomidor
  • didn't quite understand the answer - GoodWin
  • show screenshots of project tabs - Senior Pomidor
  • in project page all right take.ms/IIFfz - GoodWin
  • one
    need to write ./src/main/java/org/Council/test.txt - Senior Pomidor

1 answer 1

when you open as a project, the paths start with the folder of this project. therefore, paths must be specified with ./src/main/

In your case it will be ./src/main/java/org/Council/test.txt

I remind you that ./src/main/java/org/Council/ not intended for storing resources. for this, use the resources folder