Konrad Jamrozik
Konrad Jamrozik

Reputation: 3556

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

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

Upvotes: 4

Views: 1074

Answers (1)

dMb
dMb

Reputation: 9337

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.

Upvotes: 6

Related Questions