Reading a resource file from within jar
I would like to read a resource from within my jar like so: File file; file = new File(getClass().getResource(“/file.txt”).toURI()); BufferedReader reader = new BufferedReader(new FileReader(file)); //Read the file and it works fine when running it in Eclipse, but if I export it to a jar, and then run it, there is an IllegalArgumentException: Exception in … Read more