Fix build error with JRuby on Travis CI

https://github.com/travis-ci/travis-ci/issues/1948