Relative Content

Tag Archive for javajarpropertiesexecutable

Setting Up Properties in a JAR Executable

I have made a program that uses multiple classes that do various tasks. Every class however will need to reference the same file path every run. So, in my jar executable I have a properties file that has 2 properties, filePath and installStatus. When I first run the program it tests installStatus and if thats “false” then the user is prompted to select a location where certain files and folders are created. My default values in my jar config.properties is ‘FileLocation=null’ and ‘Install=false’. This properties file (in eclipse) is located in the same package as my classes for ease of access. When I access config to test the install status (to ensure I’ve ran the program once and made the necessary files) I get no errors and the program proceeds to install properly. My code for the execution to find these properties is as below: