fix failing to build on java 6 and below