aspose file tools*
The moose likes Beginning Java and the fly likes Launch Multiple JVM From Within A Java Process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Launch Multiple JVM From Within A Java Process" Watch "Launch Multiple JVM From Within A Java Process" New topic
Author

Launch Multiple JVM From Within A Java Process

jason williams
Greenhorn

Joined: Nov 17, 2004
Posts: 14
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

Joined: Jun 01, 2010
Posts: 618
Here's required reading when using Runtime.exec(). I see that it's 10 years and one day old today :-)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19544
    
  16

And still very relevant.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36516
    
  16
It's a little easier if you use the ProcessBuilder class, but otherwise Daconta's comments still apply unchanged.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Launch Multiple JVM From Within A Java Process
 
Similar Threads
Swing in Opera browser
Flash Builder
Webstart to use jre 1.4
launching images with a specified application from java on a MAC
Calling Java from Java