use

abstract fun use(jdkHomeLocation: File, jdkVersion: JavaVersion)

Configures the JVM toolchain to use the JDK located under the jdkHomeLocation absolute path. The major JDK version from javaVersion is used as a task input so that Gradle avoids using task outputs in the build cache that use different JDK versions.

Note: The project build fails if the JRE version instead of the JDK version is provided.

Parameters

jdkHomeLocation

The path to the JDK location on the machine

jdkVersion

The JDK version located in the configured jdkHomeLocation path


open fun use(jdkHomeLocation: String, jdkVersion: Any)

Configures the JVM toolchain to use the JDK located under the jdkHomeLocation absolute path. The major JDK version from javaVersion is used as a task input so that Gradle avoids using task outputs in the build cache that use different JDK versions.

Note: The project build fails if the JRE version instead of the JDK version is provided.

Parameters

jdkHomeLocation

The path to the JDK location on the machine

jdkVersion

JDK version located in the configured jdkHomeLocation path. Accepts any type that is accepted by JavaVersion.toVersion.

Throws

if the given jdkVersion value cannot be converted