Hello,
I have a basic executable JAR with manifest.txt containg the MainClass and some other jar dependencies.
I wanted to move my config file, "application.properties" outside the jar into a directory where it's easy to configure/maintain. The java code does a simple ResourceBundle.getBundle('application.props') to load it.
I have a directory setup that looks like this:
/bin/run.sh
/lib/stuff.jar
/common/application.properties
My run.sh looks similiar to this:
TOOLNAME="stuff.jar"
CLASSPATH="../common"
java -cp ${CLASSPATH} -Dapplication.props=application -jar ../lib/${TOOLNAME}.jar &
When I run this, the jar runs, but still seems unable to find the application.properties file.
I'm not sure if this is somehow due to the manifest.txt overriding my -D parameter. Also wondering, is it possible to move the classpath for this "../common" folder into the manifest.txt?