I still have the question why java would direct to STDERR and not STDOUT.
When a command-line utility (in this case "java") offers a "-v" (or "--version") option to print its version number, it's actually fairly common for the version string to be printed to STDERR rather than to STDOUT, especially if the app tends to write actual data to STDOUT. This is so that the version string won't get treated as actual data in a typical pipeline. (Your case is exceptional: you want the version string treated as data, so you have to explicitly make it do that.)
| [reply] |