This question is about the values of process.exitValue().
If process.exitValue()=0 its ok, if it's -1 something is wrong, but if it's something else, what does it mean? For instance i am taking 6. That is the code i use:
Process process = Runtime.getRuntime().exec(command);
process.waitFor();
Integer result = process.exitValue();
Edit: if process hangs, than process.exitValue() = 6
That's up to the process in question. Even the "0 means success" is a convention more than anything else - although it's a very common one.
In general I would assume that any non-zero value is an error of some description; look at the documentation for whatever process you're executing for the meaning of specific exit values. If you don't know as the developer what process you're executing (e.g. it's user-specified) then there's no general way of interpreting a non-zero exit code other than "failure".
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