make build compatible with Java 6 & 7