Use Java 10 instead of 9 where possible, downgrade to 8 when not (#3620)
As I understand it, 10 is supported because it's the latest release,
and 8 is supported because it's the latest LTS release, but 9 is not
supported. Therefore using 9 is probably not representative of a
production setup.