9

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?

3
  • That depends on the process you are running. You need to consult the document of the particular program. There is no general standard. Commented Aug 2, 2013 at 11:14
  • This depends on the process you have executed. The return code from that process is returned here. Commented Aug 2, 2013 at 11:15
  • Which program is this? Commented Aug 2, 2013 at 11:16

5 Answers 5

12

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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.

Comments

1

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.

Comments

1

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

Comments

-2

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 !!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.