ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL url = classLoader.getResource("com/x/y/z.cfg"); File file = new File(url.getPath());
This works when running a jar file from Eclipse, but does not work when running in a jar file.
java.io.FileNotFoundException: file: \ C: \ Users \ nova \ Desktop \ Matcher.jar! \ c ohm \ x \ y \ z.cfg
This is not a duplicate. I checked all the other questions, no useful information.
java eclipse
Insignificant person
source share