Is it possible to add new values to Java System Properties. If there is any how can introduce new keys with there corresponding values in Java System Properties.
Programmatically, a system property can be set using the setProperty method of the System object, and also via the setProperty method of the Properties object that can be obtained from System via getProperties.
properties file located in users->appdata->locallow->sun->java>deployment and also directly putting key=value in runtime parameter in java control panel but not working. Edit: We use jeety server for deployment.
Either System.setProperty
or use the -Dname=value
flag when you start the JVM
Yes:
public static void main(String args[]) { String key = "a new property"; System.setProperty(key, "a property with a value"); System.out.println(System.getProperty(key)); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With