I am new to Java and intellij Idea, I was following a tutorial on how to read a file in java, when I entered any type of file path, filename ( the main class and the other file were in the same directory ), path from content root, source root, it gave FileNotFoundException except using the absolute path.
I was expecting it to work only using the filename, because the main class and the other file is in the same directory. But Intellij gives FileNotFoundException
I don’t have a problem with using the absolute path but if I run my project anywhere else other than my computer than it will not work. That’s why I want to know the solution to this problem so i can run my project on other places too.
Lovekesh Solanki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.