Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reading the property in java from command line

Tags:

java

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

like image 562
London Avatar asked Nov 29 '22 17:11

London


2 Answers

String value = System.getProperty("thread.count");
like image 102
duffymo Avatar answered Dec 05 '22 03:12

duffymo


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.

like image 35
Jeremy Whitlock Avatar answered Dec 05 '22 01:12

Jeremy Whitlock