simon
Posts: 2
Nickname: amator
Registered: Jun, 2002
|
|
Re: a complicated question
|
Posted: Jun 23, 2002 6:50 PM
|
|
> This isn't really a Java question, but I'll let you > off the hook this time. However, as punishment, > I'll only give you the answer for the Windows > platform. When you launch the command shell with > exec(), you need to pass the program that you want to > run (which could be a shell script you dynamically > generated, by the way). To do this, you can use the > /c option if you want the shell to terminate when the > process is complete, or the /k option if you want it > to remain. So, if it was a Java program you wanted > to launch in another shell, you call "cmd /c java > [YourProgramName]" -- By the way, I would usually > recommend not using the name "cmd" directly, but > instead suggest getting it from the %comspec% > environment variable; however I don't know how to get > ahold of this variable in Java, as it doesn't seem to > be one of the environment variables that is passed > through and exposed via the system properties.
Thank you for your answer,but the answer is not suit for my question.I think if you use the exec(),you can derive output and error information from it. But how can i input the data if the program need it?
|
|