Fix the build for JDK9. Also switch to Gradle 4.4.1.

4 jobs for fix-build-on-jdk9 in 13 minutes and 46 seconds (queued for 8 minutes and 30 seconds)