For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

setJavaHome

abstract fun setJavaHome(@Nullable javaHome: @Nullable File): LongRunningOperation(source)

Specifies the Java home directory to use for this operation.

org.gradle.tooling.model.build.BuildEnvironment model contains information such as Java or Gradle environment. If you want to get hold of this information you can ask tooling API to build this model.

If not configured or null is passed, then the sensible default will be used.

Return

this

Since

1.0

Parameters

javaHome

to use for the Gradle process

Throws

when supplied javaHome is not a valid folder.