CapturingProcessAdapter (ProcessOutput processOutput) { return new CapturingProcessAdapter(processOutput) { @Override public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) { myDebugProcess.printToConsole(event.getText()); } @Override public void processTerminated(@NotNull ProcessEvent event) { if (!sudo && myDebugProcess.isInInitialState()) { try { startServer(finalCommandLine, true); } catch (Exception e) { LOG.error(e); } } else { myDebugProcess.stop(true); } } }; }