Improvements to JDK 7 + 8 compatibility in build.