Why does new File(path) doesn’t work when I run my application from jar? How should I change this? Now I’m receiving FileNotFound Exception when my application tries to load a file.
final File file = new File("src/main/resources/maps/ParcelsCountyRDMFinal5.shp");
If jar created properly, say using Maven, the resources files goes next to class files. It looks something like this:
you can either walk up in directory and access
fileToRead, like this for above structure:or as suggested