Java Java API
java.lang.System
public static void setProperties(Properties props)
Sets the system properties as specified props.
package com.logicbig.example.system;import java.util.Collections;import java.util.Enumeration;import java.util.Properties;public class SetPropertiesExample { public static void main(String... args) { Properties p = new Properties(); p.setProperty("one", "oneVal"); System.setProperties(p); Enumeration<?> e = System.getProperties().propertyNames(); for (Object obj : Collections.list(e)) { String prop = (String) obj; System.out.println(prop + "=" + System.getProperty(prop)); } }}
one=oneVal