improve support for jdk 1.8