Take the 2-minute tour ×

What all parameters can we give to exec() function. Please give me the link for this which can give me the details of the different parameters that can be executed.. All help is appreciated

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

It are the same parameters as you would give in the "command prompt". So the answer depends on the command prompt of the underlying operating system you're using. In case of for example Windows XP, you can find documentation here. Specifically, the list of all commands can be found here.

share|improve this answer
add comment

You can find all the parameters for exec in the Runtime javadoc. You can give it pretty much any command you would execute at a shell prompt.

I also found a good JavaWorld article, When Runtime.exec() won't, that explains its usage.

share|improve this answer
Apparently only after Oracle will fix their new website ( Sun is no longer worshiped I guess ). –  Alexander Pogrebnyak Jul 13 '10 at 18:04
@Alexander: I don't know what that means. Are you having trouble with the link? –  Bill the Lizard Jul 13 '10 at 18:19
noooooooooo i dont have any.. thanx –  prasad Jul 13 '10 at 18:23
@Bill, it's been touch and go the whole day. I really "love" the pseudo-random id now in the javadoc URL. I guess without id, it's not Oracle-proof :). BTW, +1 for the JavaWorld article. –  Alexander Pogrebnyak Jul 13 '10 at 19:11
@Bill, I think it's an Oracle requirement, that URL should have at least 20 extra dead weight characters. For example, if you had any doubts that you are looking for docs, they've included it there twice. :) –  Alexander Pogrebnyak Jul 13 '10 at 19:32
show 1 more comment

Maybe you could describe the issue you are having ?

Look at this link: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
This one is also good: http://www.java-tips.org/java-se-tips/java.util/from-runtime.exec-to-processbuilder.html

share|improve this answer
add comment

Your Answer


