Fix Java 7 detection

For legacy reasons, Java directs `-version` output to stderr rather than stdout.

The current implementation of `require_java7` (quite reasonably!) expects the version to be on stdout, resulting in failed checks when a valid JRE 7 installation exists. 

This pull request redirects stderr to stdout for parsing and modifies the test stubs to behave identically to Java.