Is there a complete List of JVM exit codes

KIC picture KIC · Jul 16, 2013 · Viewed 17.3k times · Source

I am looking for a complete list of all possible jvm exit codes (not java System.exit(x)). The only thing I could find by using a search engine is a list of SIGTERM exit codes: http://journal.thobe.org/2013/02/jvms-and-kill-signals.html . I want to know if there are specific exit codes for uncatched Exceptions?

Answer

Amit G picture Amit G · Jan 18, 2014

Argument passed to System.exit(x) -> becomes the JVM exit code.

Exit code 0 is used to indicate normal exit. Unique positive exit code to indicate specific problem.

I want to know if there are specific exit codes for uncatched Exceptions?

No. If all non-daemon threads exit normally(presence/absence of exception does not matter), JVM terminates with 0.

Exit code between 1 and 127 are specific codes used to indicate error in JVM. e.g. mismatched jdk/jre versions, incorrect memory configuration/command-line options, etc.

About the link

http://journal.thobe.org/2013/02/jvms-and-kill-signals.html

JVM exit due to specific signal would be

128+signal-id

List of signal-id can be found using kill -l