Skip to content

Instantly share code, notes, and snippets.

View gist:0600e4e487741a1401b5e049cc2af6e1
private InputStream readProperties() throws IOException {
File jarPath = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().getPath());
JarFile jarFile = new JarFile(jarPath);
JarEntry entry = jarFile.getJarEntry("PROPERTY_NAME");
InputStream input = jarFile.getInputStream(entry);
return input;
}
You can’t perform that action at this time.