Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Process.exitValue() only returns the low byte of the exit code?

User731477-OracleApr 26 2013 — edited Apr 26 2013
Hi - I'm executing a subprocess and then waiting for it to return, and then examining the exit code of the subprocess. The error the subprocess returns is 0xb03, but exitValue() only sees 0x03. Further testing shows that if I return 0xbff from my native process, exitValue() or waitFor() will only return 0xff. I expanded this further to return 0xfffffbff, and sure enough, the Process methods only return 0xff.

Anyone know what the deal is here? The return type for exitValue() and waitFor() are both 'int', so it seems reasonable to be able to return values up to 0xffffffff. Is there a way to set this up to sue the full int?

Thanks for any insight.
This post has been answered by EJP on Apr 26 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2013
Added on Apr 26 2013
3 comments
3,088 views