• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Launch Multiple JVM From Within A Java Process

 
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
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And still very relevant.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49361
62
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic