Use jvm running gradle if it's compatible with targetCompatibility

This commit is contained in:
AsamK 2024-06-06 10:39:26 +02:00
parent 67012b40b1
commit 8b355918e8

View file

@ -12,8 +12,10 @@ java {
sourceCompatibility = JavaVersion.VERSION_21 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21
toolchain { if (!JavaVersion.current().isCompatibleWith(targetCompatibility)) {
languageVersion.set(JavaLanguageVersion.of(21)) toolchain {
languageVersion.set(JavaLanguageVersion.of(targetCompatibility.majorVersion))
}
} }
} }