我知道使用
ErrorStream
或OutputStream
,您需要按照以下步骤进行操作:Process process = Runtime.getRuntime ().exec ("the command you want to execute");
OutputStream stdin = process.getOutputStream ();
InputStream stderr = process.getErrorStream ();
如果我不想启动一个新进程,而是想获取我正在工作的当前应用程序的ErrorStream
和OutputStream
(当前进程),该怎么办?
如何获取它?
System.out
和System.error
。 - Bala R