Suppose i have the following excerpt of a MANIFEST.MF of an executable jar file:
Shouldn't it be possible to have a directory structure like this:
|- bla.jar (self-executable)
Because if i try to load the properties with the following code-fragment i get a IOException: Stream closed in properties.load(stream):
Properties properties = new Properties();
BufferedInputStream stream = new BufferedInputStream(istream);
The exception is a bit misleading as actually istream is null (remarked that as i tried to call a method of istream for testing purposes...), so the properties-file isn't found and i have no idea why it fails because according to Executable jar won't find the properties files it should work this way...
getResourceAsStream are reliant on the class loaders implementation & class path.
I tend to only use this approach when I'm looking for embedded resources, but that's just me
You "could" try