RFR: 7904083: Print fatal error messages to stderr

SendaoYan syan at openjdk.org
Fri Sep 26 12:50:18 UTC 2025


On Fri, 26 Sep 2025 10:24:48 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Hello @sendaoYan, can you add some more details about what prompted this change? I can understand that printing an error to stderr would seem more logical. However, given that it has been this way forever, if there is no strong reason for changing this, then I think it would be better to leave this as-is.

Hi @jaikiran 

I want to make this change because I want to use jtreg -version to check if the current jtreg command works properly. Therefore, I'll use the following code to perform a check. If all is well, I'll proceed with the script. The check script is as follows. Why is standard output redirected to /dev/null? In this case, we're not interested in the jtreg version number; we're only interested in the error message when jtreg -version fails to start properly.


if ! jtreg -version > /dev/null ; then
    echo jtreg -version check fail! >&2
    exit 1
fi
Do the following...Such as running the specific jtreg tests.

-------------

PR Comment: https://git.openjdk.org/jtreg/pull/290#issuecomment-3338573382


More information about the jtreg-dev mailing list