is it possible to add to the classpath of a runnable jar file some properties file? I tryed these solutions solutions:
running the executable file using the
You have to reference the .properties file in your class file relative to the .jar file location. The classpath seperators are different for Windows (semicolon) and Unix environments (colon).
For windows
java -classpath .;prop_dir; -jar Runnable.jar (In your Class file, the properties file should be accessed by relative URl from classpath say "prop_dir/prop1.properties")
For Unix env
java -classpath .:prop_dir: -jar Runnable.jar (In your Class file, the properties file should be accessed by relative URl from classpath say "prop_dir/prop1.properties")
Code:
Output: