Modified to build on JDK7 as well as JDK8