• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send parameters to JVM?  RSS feed

 
Satish Kota
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
How to send parameters to JVM and how to access them through out the life time of programe.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possibility is to pass them as command line parameters, like this:

java MyClass param1 param2

Then, in your main method, the parameters can be found in the "args" array that gets passed to the main method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!