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?
The JVM is interrupted (by using ctrl C or sending SIGINT). The JVM is terminated (by sending SIGTERM) One of the threads calls System. exit() or Runtime.
The main alternative is Runtime. getRuntime(). halt(0) , described as "Forcibly terminates the currently running Java virtual machine". This does not call shutdown hooks or exit finalizers, it just exits.
exit(0) : Generally used to indicate successful termination. exit(1) or exit(-1) or any other non-zero value – Generally indicates unsuccessful termination. Note : This method does not return any value.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With