Fix Java 7 detection - closes #861