# setTargetCompatibility

abstract fun setTargetCompatibility(value: JavaVersion)(source)

Sets the target compatibility used for compiling Java sources.

This property cannot be set if a toolchain has been configured.

#### Parameters

value

The value for the target compatibility

#### See also

toolchain(Action)

abstract fun setTargetCompatibility(value: Any)(source)

Sets the target compatibility used for compiling Java sources.

#### Since

7.1

#### Parameters

value

The value for the target compatibility as defined by toVersion