London
London

Reputation: 15274

reading the property in java from command line

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

Upvotes: 4

Views: 11457

Answers (3)

Jeremy Whitlock
Jeremy Whitlock

Reputation: 3818

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.

Upvotes: 5

duffymo
duffymo

Reputation: 308763

String value = System.getProperty("thread.count");

Upvotes: 17

Related Questions