0

I made a program using eclipse. I have a referenced library called res, where I load my resources from. I have two folders in res, one if 'maps' the other one is 'tiles'. If I run the program from eclipse, it works how it should. However if I export it into a jar, and run that, I get an exception. I didn't have this problem, until I started to use the files in the 'maps' folder, so I'm guessing I'm not loading it as I should. As far as I know, I should load it as a resource, and that's what I do:

BufferedReader reader = new BufferedReader(new FileReader(this.getClass().getResource(path).getFile()));

(path is just a string, which is always: "/maps/map.txt")

The exception comes from the line above, and this is the exact error:

java.io.FileNotFoundException: file:\C:\TMP\App.jar!\maps\map.txt  (the filename directory name or volume label syntax is incorrect)

What am I doing wrong?

RuntimeException
  • 193
  • 1
  • 3
  • 10

0 Answers0