Why is my file not being read in, even though its path is the same as another project where the file is read in successfully?

Viewed 34

//This is where I read in my file

String fileName = "crimedata-full-month.csv";
    
    FileReader file = new FileReader(fileName);
    Scanner scan = new Scanner(file);

//This is the error I get

Exception in thread "main" java.io.FileNotFoundException: crimedata-full-month.csv (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:111)
at java.base/java.io.FileReader.<init>(FileReader.java:60)
at Crimes.main(Crimes.java:56)

This is the path it follows

I'm running this in Eclipse on my MacBook.

0 Answers
Related