My JAR currently has the following structure:
myapp.jar
META-INF
MANIFEST.MF
net
myapp
MyAppDriver.class (fully qualified as net.myapp.MyAppDriver)
<lots of other classes>
My app requires the need to read a file from the runtime classpath, and configure itself based on the contents of the file (simplelogger.properties
from the SLF4J framework).
Where do I place simplelogger.properties
in the JAR? Do I need to set anything inside MANFIEST.MF
as well?
Thanks in advance!
You can place the file in any JAR anywhere you would like. If you want it to live alongside
MyAppDriver.class
, for example, you could then callgetClassLoader().getResourceAsStream("net/myapp/simplelogger.properties")
to get anInputStream
to that file. You don't need a manifest for this to work.