• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting list of JRE args

 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a scenario in which I am passing a list of jre args to my application, and based on some of the jre args, i need to have some logic in my application to execute some code.

Is there any API which could help me get the list of all JRE args that I passed to my application when I started it up?


Thanks in advance,
Preethi
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about the String[] argument to your public static void main method?
 
Greg Charles
Sheriff
Posts: 2989
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob, I think he's talking about parameters given to the JVM, not the application parameters.

"D", any parameters of the form -Dproperty=value can be retrieved through System.getProperties(). 99% of the time, that's all you need. If you are in that last 1%, take a look at RuntimeMXBean in the Java API. It might be able to give you the information you need.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic