java - how to set custom system variable for JVM to access properties file? -


i need read config.properties file location set variable -dapp.conf=/path/to/config.properties , set datasource when launch application. file should @ location within filesystem. how this?

you can load properties file next:

properties p = new properties(); try (reader reader = new filereader(system.getproperty("app.conf"))) {     p.load(reader); } 

once loaded can use properties instance set datasource configuration.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -