开发者

Java exit codes and meanings

开发者 https://www.devze.com 2023-03-15 02:41 出处:网络
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 ful开发者_如何学Cl stack t

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 ful开发者_如何学Cl 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.


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.


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'.


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


Exit code 23 could mean "Too many open files in system"

On some Linux installs you can simply run perror 23 to look that up. If that command isn't available you can get it via a simple C program:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {
    int e = 23;
    printf("%i: %s\n", e, strerror(e));
    return 0;
}


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

0

精彩评论

暂无评论...
验证码 换一张
取 消