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
Post a Comment