Improve Java 7 detection

Java on most (all?) platforms directs `-version` output to STDERR.
Merge pull request #511 from cmattson/java7-detection

Fix Java 7 detection