Setting JDK in initialization script

I want all of our developers to be on the same JDK and I thought an initialization script would be the place to ensure that. The initialization script documentation says one possible use for initialization scripts is: "Define machine specific details, such as where JDKs are installed."
I assumed this meant that you could set “org.gradle.java.home” in a gradle.properties in the project’s root directory from an initialization script and the daemon would run using that, but that’s not what I’m seeing. The daemon is running against whatever the machine’s JAVA_HOME is set to. Instead I’m having to set compileJava.options.forkOptions.javaHome and test.executable to my JDK – which is something I could do without an initialization script. Am I missing something? How would I use an initialization script to set the JDK?

I have the same question. Don’t see any responses