Where are unhandled exceptions in command line java application printed out by default? To stdout or stderr?

后端 未结 1 716
情深已故
情深已故 2021-01-21 04:37

The title contains the entire question. I would be also grateful for a link to documentation holding an answer.

1条回答
  •  迷失自我
    2021-01-21 04:46

    In Java unhandled exceptions perculate to the top of the thread in which they were thrown. Java allows you to install a thread-level uncaught exception handler. The behavior when there is no default exception handler specified, as far as I know, is not defined by the Java specification. Sun's JDK observed default behavior is to print the exception message and its stack trace to stderr.

    0 讨论(0)
提交回复
热议问题