The method waitFor() returns an integer value which is the return code. The value 0 indicates normal termination. But what are the meanings of other return codes? I am getting an exit value 11. What does that mean? And where all the exit value codes are documented?
-
That depends on the process you are running. You need to consult the document of the particular program. There is no general standard. – kiheru Aug 02 '13 at 11:14
-
This depends on the process you have executed. The return code from that process is returned here. – Matthias Aug 02 '13 at 11:15
-
Which program is this? – tbodt Aug 02 '13 at 11:16
5 Answers
These values are arbitrary and up to the specific program to define. You should refer to documentation or source code of the program that is outputting this exit code.

- 40,868
- 9
- 92
- 93
The program return value depends on program. There is no standard for return values apart from zero meaning OK.
You have to contact author of the program or consult documentation.

- 2,825
- 6
- 27
- 44
Every application defines it's own exit codes. E.g. you have to look up the documentation of the application that you started using java.lang.Process. The only common thing they all have is that any other value than 0 is an error.
In the unix world on the other hand there are certain conventions, that many main stream utilities follow, but there are no guarantees.

- 2,282
- 1
- 14
- 22
Any value other than non-zero value indicates Abnormal termination. There is no particular rule as to what values indicate what conditions. Read the documentation for the process that you are calling.
0 --> Normal termination
!=0 --> Abnormal Termination

- 41,187
- 18
- 82
- 120
I have seen conversions happen of the nature that can convert intended negative error codes to convert as follows -
Error code –> -2001 -> Signed Decimal to Binary conversion -> 111111111111100000101111 -> Here 00101111 last 8 bit is picked up and converted back to Decimal – 47 !!

- 49
- 1
- 1