in reply to redirecting standard output and standard error

my $rc = system("java -version >/dev/null 2>&1");
might do on UNIX/Linux (redirect STDOUT to /dev/null, redirect STDERR to STDOUT closing the STDERR filehandle).

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}