• Post Reply Bookmark Topic Watch Topic
  • New Topic

Launch Multiple JVM From Within A Java Process  RSS feed

 
jason williams
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am testing my application, which consits of 1 master and 2 worker, with junit.

My question - What is the right way to pro programmatically launch another JVMs (on a single machine ) to simulate several servers running simultaneously?

Most of webpage I searched on the internet tells using Runtime.exec(). Is it recommended using this method? Or any other suggestion?

I appreciate any commentary.

Many thanks.
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's required reading when using Runtime.exec(). I see that it's 10 years and one day old today :-)
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And still very relevant.
 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a little easier if you use the ProcessBuilder class, but otherwise Daconta's comments still apply unchanged.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!