Use gradle toolchain to specify the jdk version and vendor, e.g. > gradle -no-build-cache -PjdkVersion=16 -PjdkVendor=oracle clean check