Fix JDK8 cross compilation for travis build.