0

I exported a runnable JAR file from my project. I included the resources in a separate lib folder(during export), which is alongside of the JAR file. I also copied the properties file to the root folder alongside of the JAR and the lib(folder). I am trying to run the JAR via command line. But how do I tell the properties file to refer to my drivers in my lib folder? Can I just use C:\users.... ? We usually have this all on a server, but I have to test this on my local machine. How do I also tell the java source code to refer to the properties file outside of the JAR and not the one that is inside the JAR?

Basically we want the lib and properties files/folders outside of the JAR so that we can update easily when it goes to the server, but I am trying to test all of this on my local machine.

  • Which "properties" are you talking about here, exactly? The normal method to refer to files on the system is to pass the names on the command line, or use environment variables, or have a preset default location(s). You kinda have to plan ahead for these things. – markspace Jan 26 '18 at 22:13
  • Thanks for replying. I am sorry, still new to this. The person working on this gave me a zip (project) I imported it into blank workspace. Properties file is actually in the Enterprise Explorer pane. – nottheonion Jan 26 '18 at 22:35
  • I think I just need a mini break down of how the properties files work and are loaded in a project and JAR files. Just pass in props in main with arguments? – nottheonion Jan 26 '18 at 22:36
  • The properties file has resource IP addresses, driver locations, and which environment details (dev, prod) etc. – nottheonion Jan 26 '18 at 22:39
  • you're going to have to use a resource package and copy that over when you build your artifacts and use relative package location. – Sam Orozco Jan 26 '18 at 23:31

0 Answers0