Fix for build on jdk8 and slower machines