RFR: 8027765 Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent

Staffan Larsen staffan.larsen at oracle.com
Thu Nov 14 04:12:04 PST 2013

I’ve been trying to copy whatever javac does to be consistent. From the bug report:

* If the arguments are wrong or not specified: exit code != 0, usage output on stderr
* If -help or -h is specified: exit code == 0, usage output on stderr


On 14 Nov 2013, at 11:08, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 14/11/2013 09:46, Weijun Wang wrote:
>> But it's changing from stdout to stderr in the webrev. At least GNU believes [1] it should go to stdout. It make the output more'able.
> This is a confusing topic. I think the normal convention is that when there are invalid arguments that usage message is essentially the error message and so should go to stderr with the program exiting with an error code. On the other hand, -help is supposed to print to stderr and exit with a success. We should double check the launcher to make sure that we are consistent (although it has its own issues there).
> -Alan.

More information about the serviceability-dev mailing list