I have several stand-alone (no web container) java programs that I want to run on multiple systems (Unix, Windows, test, production environments). There are several configuration parameters that I need to keep out of the jar for easy modification.
What's the best way to do this?
Some options I've considered are: 1) Using a straight properties file and passing the full path name of this file as a command line option. (Works but was hoping for a better way.)
2) Using a properties file and access it through a resource bundle. (Not working for me. I have to run the app as a jar and can't seem to have the app find the resource outside the jar, no matter what classpath settings I use.)
3) Using Spring framework and an XML config file. (Essentially the same as 1 and 2, you still have to tell spring where to find the config file.)
4) System enviroment variables. (Haven't tried this yet.)