load file within a 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");

Leave a Comment