Hi,
If a property file is required by a jar, it is a general practice that the property file is packaged inside the jar. I'm not sure why you are keeping it out of jar.
Anyways, what you want can be achieved by one of the following ways:
1) Keep your property file in a directory (say /config/props) and keep that dir in CLASSPATH (or provide it as -cp option during runtime).
2) Or, assign an env variable to the path of that dir, and then access the file (e.g. $CONFIG_PATH=/config/props, and then access $CONFIG_PATH/config.properties)
3) Keep the property file at a specific relative location from current jar, and then access it (e.g. ../config/config.properties).
Even if you are using
IDE like Eclipse, it is not necessary to keep your property file under src dir. You can still keep the file at location of your choice, and include it in classpath (or env variable) while executing your code in Eclipse.
However, please be sure to handle FileNotFoundException in all cases.
Personally, I'll strongly suggest to keep file inside jar, or follow first option from above list.
I hope this helps.