import java.util.Map; import java.util.Properties; public class SystemPropertiesTest { public static void main(String[] args) { Properties property = System.getProperties(); Map<String, String> env = System.getenv(); for (Map.Entry<String, String> keyValue : env.entrySet()) { if (!property.containsKey(keyValue.getKey())) { property.setProperty(keyValue.getKey(), keyValue.getValue()); } } } }