load file within a jar
Why do you need a file? IF you need to read the config use
Class.getResourceAsStream("/my.conf");
This will need only to be the file in the one folder with the root of your package( the same as in the root of the jar)
You should use getResourceAsStream()
instead. If the file is embedded in your JAR the URI is most likely bundle:// URI
InputStream is = this.getClass().getResourceAsStream("my.conf");