Home > Software design >  How to make Java Error line keep in its supposes line instead of having it in the bottom or the top
How to make Java Error line keep in its supposes line instead of having it in the bottom or the top

Time:11-22

when I try to use System.err.println() command, its always shows the error code in the bottom or the top of the terminal output instead of having it in its supposed line

Expectation

Reality

CodePudding user response:

Stdout (out) and Stderr (err) output streams are not synchronized by design. The special handling is required to make the output from two different streams synchronous.

Please see the corresponding issue in IntelliJ IDEA bug tracker.

As a result of fixing this issue, a Registry option was provided to synchronize these streams. The drawback is that IDE will no longer show err output in red as the output from these two streams will be merged.

To activate this option use Help | Find Action, type Registry, then find and enable run.processes.with.redirectedErrorStream option.

You can find more details in this comment.

See also my related answer here.

Unfortunately, it was broken again in 2020.* releases after the Run Targets were introduced. We've submitted and fixed a corresponding bug. The fix should be available in one of the next updates. If this functionality is critical for you, you can use 2019 release from https://www.jetbrains.com/idea/download/previous.html until the fix is released.

  • Related