I would like to know how to enter commands into the cmd.exe (command prompt window) , after its been opened?
I have the code below to open cmd.exe:
Runtime rt= Runtime.getRuntime();
Process process= rt.exec("cmd.exe /c start cd c:\\ExecutionSDKTest_10.2.2");
But after it’s been opened, I’d like to enter “ant compile” or any line, how do I do that??
The normal way to do this would be to put the commands in a script and execute the script.
You will need to consume the output of the child process (stdout and stderr) on separate threads, or your process will block.