I am having issues with properties file when I try to make my standalone Java aplication a runnable jar. I have 2 properties file, depending upon the machine where its running one gets initialized. Inside eclipse it was working fine. I was using:
Properties configProps = new Properties();
....
if(machine1)
....
configProps.load(Config.class.getResourceAsStream("machine1.properties"));
else
configProps.load(Config.class.getResourceAsStream("machine2.properties"));
It was working as Config.java and properties were in the same package. On top of that I have log4j properties located on the root of the project. That is also not working whne i made Jar.
How to handle the current sutuation.I know putting properties file outside jar is good idea. How do I accomplish this.
Please help.