Skip to content

Commit 9dc975d

Browse files
committed
docs: update quick-start
1 parent f7e84e3 commit 9dc975d

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

docs-source/src/en/guide/quick-start.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ Modify the Java version of Kotlin in your project's `build.gradle.kts` to 17 or
3939

4040
> Kotlin DSL
4141
42-
```kt
42+
```kotlin
4343
android {
4444
compileOptions {
4545
sourceCompatibility = JavaVersion.VERSION_17
4646
targetCompatibility = JavaVersion.VERSION_17
4747
}
48-
kotlinOptions {
49-
jvmTarget = "17"
48+
}
49+
50+
tasks.withType<KotlinJvmCompile>().configureEach {
51+
compilerOptions {
52+
jvmTarget.set(JvmTarget.JVM_17)
5053
}
5154
}
5255
```

docs-source/src/zh-cn/guide/quick-start.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ repositories {
3636

3737
在你的项目 `build.gradle.kts` 中修改 Kotlin 的 Java 版本为 17 及以上。
3838

39-
```kt
39+
```kotlin
4040
android {
4141
compileOptions {
4242
sourceCompatibility = JavaVersion.VERSION_17
4343
targetCompatibility = JavaVersion.VERSION_17
4444
}
45-
kotlinOptions {
46-
jvmTarget = "17"
45+
}
46+
47+
tasks.withType<KotlinJvmCompile>().configureEach {
48+
compilerOptions {
49+
jvmTarget.set(JvmTarget.JVM_17)
4750
}
4851
}
4952
```

0 commit comments

Comments
 (0)