I think you are talking about starting a standard run of stdout on the current process. If you are using JDK7, it is simple:
.redirectOutput(ProcessBuilder.Redirect.INHERIT)
Update: (too much for comment) I think you are confused. When you start a process from a terminal, the process becomes a child of this terminal process, and stdout is sent to this terminal. When you start a process from Java, this process is a child of the Java process, and its stdout switches to Java.
In the first case, there is a terminal showing stdout, because you started it from the terminal yourself and that you use stdout with the terminals. However, when starting from Java, there would not be a window if only something in the process that you started did not open the terminal, and the beginning of the process that you started is transferred to you, the programmer, at your discretion. The equivalent behavior that you see when starting from the terminal is Redirect.INHERIT
, which I already mentioned.
Your problem right now is not in Java. Your problem is not understanding how this "srcds.exe" expects stdin and stdout to be processed. Extract this and then go back and ask how to do it with Java.
I guess right now, but you can try reading from the stdout process and returning it back to stdin. Maybe this is what he expects? That sounds crazy, however.
source share