How to change Java properties at runtime?

前端 未结 5 1541
温柔的废话
温柔的废话 2021-02-07 08:33

The question: Is there some way to \"connect\" to a running JVM and change system properties (given by -Dproperty=value) without stopping the JVM and without having programmed a

5条回答
  •  孤街浪徒
    2021-02-07 08:53

    Example found in one of my code:

    System.setProperty("javax.net.ssl.trustStore", keystore_file); 
    

    You can run it in response for "reconfigure" query (add reconfigure() to your server code).

提交回复
热议问题