The idea is to use:
One JDK to run Gradle: whatever it needs, let's say JDK8.
One JDK to build the "main", published code: JDK8.
One JDK to build and run the tests: JDK 8 / 11 / 15 / 16, in different Jenkins jobs.
That can be done in Gradle 6.7 with the help of toolchains. We've already done it in Hibernate Reactive: https://github.com/hibernate/hibernate-reactive/pull/430
Wow, very nice!
btw, Gradle 6.8 was just released