gradle
8.3

# setJavaHome

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

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

#### Parameters

javaHome

to use for the Gradle process

#### Throws

IllegalArgumentException

when supplied javaHome is not a valid folder.