language: java

matrix:
  include:
    - os: linux
    - os: osx
      env: JAVA_HOME=$(/usr/libexec/java_home)

language: java
jdk:
  - oraclejdk8
matrix:
  include:
    - os: linux
    - os: osx
      osx_image: xcode9.3

Use Java 8 on Travis
Use Java 8 on Travis

Currently Java 10 is the default on Travis but the project does not yet
compile with Java 10. Specifying the desired JDK version is anyway a good
idea.

For OSX the image has to be specified as it corresponds to a dedicated
Java version. For more details see
https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
