reading the property in java from command line

前端 未结 3 392
温柔的废话
温柔的废话 2021-01-19 16:37

How to read some property passed from command line like -Dthread.count I saw it, but I\'m not sure how to read that one in java code

相关标签:
3条回答
  • 2021-01-19 16:47

    Use System.getProperty("thread.count");

    0 讨论(0)
  • 2021-01-19 16:56

    Java has this documented:

    http://download.oracle.com/javase/tutorial/essential/environment/sysprop.html

    Basically, you're reading in the value of a System Properties. The link above gives you an example.

    0 讨论(0)
  • 2021-01-19 17:04
    String value = System.getProperty("thread.count");
    
    0 讨论(0)
提交回复
热议问题