santosh
santosh

Reputation: 1

start multiple java programs (multiple JVM) from one command

I want to start multiple java programs (multiple JVM) from one command.

Ex: I have two different application(lets say A and B) which solve their job independently. Now instead of running these two application separately in form of two JVM i want to bundle these two into another application or module (lets say CC). So if i start C this should start A and B in two separate window or jvm so that i can release or deploy only one module C in stead of A and B separately.

please guide me how to do that.

Thanks Santosh

Upvotes: 0

Views: 1639

Answers (1)

Daniel Sperry
Daniel Sperry

Reputation: 4491

From your comments, this is a windows question, and you are already using a batch file to start your app, so use the start command in a batch file (check this question for more details):

start java YourClassA arg1 arg2 ...
start java YourClassB arg1 arg2 ...

If using linux/unix write a shell script and add & to the end of the java startup lines, (check this question for details):

java YourClassA arg1 arg2 &
java YourClassB arg1 arg2 &

You can also create a java class C that uses the ProcessBuilder to start the two other programs (apparently an overkill for you problem). Check this question if you want to do that.

Upvotes: 1

Related Questions