There's always Gradle Toolchains as well, which allows you to put the JDK configuration in the branch next to the source code.