nowadays I'm learning Maven. I have a problem with reading json file from resources folder in my app. I've got an error message "System cannot find this file". What is more interesting, there is no problem while I'm trying to read txt file...
As you can see on image below this two files are on the same place in my app. Why my json file are not reading correctly?
//WORKING
String filename = "./resources/data/init_data.txt";
try (Stream<String> lines = Files.lines(Paths.get(filename))){
lines.forEach(System.out::println);
} catch (Exception e){
e.printStackTrace();
}
//NOT WORKING
Gson gson = new Gson();
filename = "./resources/data/car.json";
try (Reader reader = new FileReader(filename)){
Car car3 = gson.fromJson(reader,Car.class);
System.out.println(car3);
} catch (IOException e){
e.printStackTrace();
}

