views:

11

answers:

0

As in title. Lets say I have an application which I run with argument "doSth". What I want to do is tu run subprocesses with the same command but with different arguments.

Example:

java -jar test.jar doSth

and this process runs:

Runtime.exec("java -jar test.jar doSthA")
Runtime.exec("java -jar test.jar doSthB")

Another:

java MainClass doSth

runs:

Runtime.exec("java MainClass doSthA")
Runtime.exec("java MainClass doSthB")

How can retrieve command which was used to run java application?

I've got to use Java 1.4.2.