問題は...私はライブラリのDefaultExecutor
クラスでプロセスを実行しています。org.apache.commons.exec
このような:
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
CommandLine cmd = new CommandLine("java");
DefaultExecutor exec = new DefaultExecutor();
exec.setExitValue(1);
exec.execute(cmd);
}
その出力を別のスレッドで「実行中」に取得して、他の場所に記録する必要があります。それを達成するための最良の方法は何ですか?