How to change the path of jdk which Gradle use

I’m using the Gradle-8.1.1 to build some projects. And now I have compiled the jdk-17 source code to add some print. So now I’d like to change the Gradle’s using Java, the Java’s path just like “/home/jdk-17/XXX/images/jdk/bin/java”, how to set it?

How to set what?
There Java version used to run your build?
That depends on how you start Gradle.
If you start it from commandline, just set JAVA_HOME.
If you start from IDE, configure it in the IDE settings.

1 Like