Fix travis jdk8 declaration error.

Check https://github.com/travis-ci/travis-ci/issues/1647 for details.