Please, see documentation here: http://javalite.io/database_connection_management#using-system-property
Basically, provide the location of your database.properties
file as a system property:
java com.company.project.Main -cp myprogram.jar -Denv.connections.file=/path/to/file/database.properties
However, if it does not work for you, it is because of this bug that was fixed in Feb 2018:
https://github.com/javalite/activejdbc/issues/681
so, if this configuration does not work, keep in mind that the file is searched on the classpath. This means that if you put your file somewhere on the file system and list the directory of this file first on your classpath, your file will be found first as opposed to the one packaged into the Jar file.
So, if your file is: /opt/project/dir1/database.properties
, you can start your process:
java -classpath /opt/project/dir1/:$CLASSPATH com.yourcompany.Main
then the file /opt/project/dir1/database.properties
will be loaded first.