Java exit codes and meanings

2019-02-11 23:50发布

问题:

Is there a list of exit codes and meanings for java process terminations? Because I have an exit code 23 and i don't know what it can be (I cannot change the log to see the full stack trace because it sits in a different remote server).

I browsed it for hours and couldn't find any mentioning of exit code 23.

回答1:

In your Java application, when you call System.exit(n);, then the Java runtime environment will return n as the exit code back to the operating system.

What the number means depends on the program you are running - not Java itself, but the program you are running produces this number. There are no standard numbers. Look in the documentation of the program that produces this exit code to find out what it means.



回答2:

There is no definition for what exit code 23 means. Exit codes have no convention on what the values represent other than that a nonzero status code indicates abnormal termination. Zero indicates success but even then it is completely dependent as to whether the developer adheres to this 'standard'.



回答3:

In another question there's a link to a page with JVM exit code explanations. But exit code 23 seems to be mysterious.



回答4:

I compiled some "standard" exist codes I use across my apps in a enum, the exit codes are based on freebsd sys exits + jvm signaled exits, see SysExits.java for more detail.



回答5:

In Eclipse RCP exit code 23 means restart. But it works under IDE only.