How to add new System Properties in java

后端 未结 3 416
不知归路
不知归路 2021-01-03 19:12

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.

3条回答
  •  礼貌的吻别
    2021-01-03 20:01

    System.setProperties(properties object);
    

    This will set the system properties.

    If you want to set a specified property, then use

    System.setProperty(key, value);//Both key and value should be string.
    

    NOTE: This will first check the permission and then set it. If permission denied, then SecurityException may occur.

提交回复
热议问题