Skip to content

Commit 75d0ec3

Browse files
authored
将构建项目所需的最低 JDK 版本升级至 11 (#3805)
1 parent d70712a commit 75d0ec3

6 files changed

Lines changed: 8 additions & 19 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up JDK 8
16+
- name: Set up JDK 11
1717
uses: actions/setup-java@v4
1818
with:
1919
distribution: 'zulu'
20-
java-version: 8
20+
java-version: '11'
2121
java-package: 'jdk+fx'
2222
- name: Build with Gradle
2323
run: ./gradlew build --no-daemon

HMCL/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ val java11 = sourceSets.create("java11") {
9595
}
9696

9797
tasks.getByName<JavaCompile>(java11.compileJavaTaskName) {
98-
if (JavaVersion.current() < JavaVersion.VERSION_11) {
99-
javaCompiler.set(javaToolchains.compilerFor {
100-
languageVersion.set(JavaLanguageVersion.of(11))
101-
})
102-
}
10398
options.compilerArgs.add("--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED")
10499
sourceCompatibility = "11"
105100
targetCompatibility = "11"

HMCLCore/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,4 @@ dependencies {
1818
api("org.jsoup:jsoup:1.19.1")
1919
api("org.glavo:chardet:2.5.0")
2020
compileOnlyApi("org.jetbrains:annotations:26.0.1")
21-
22-
if (JavaVersion.current().isJava8) {
23-
org.gradle.internal.jvm.Jvm.current().toolsJar?.let {
24-
compileOnly(files(it))
25-
}
26-
}
2721
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The software is distributed under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.h
4141
If you want to submit a pull request, here are some requirements:
4242

4343
* IDE: IntelliJ IDEA
44-
* Compiler: Java 1.8 or Java 11+
44+
* Compiler: Java 11+
4545
* Do NOT modify `gradle` files
4646

4747
### Compilation
@@ -52,7 +52,7 @@ Simply execute the following command in the project root directory:
5252
./gradlew clean build
5353
```
5454

55-
Make sure you have at least JavaFX 8 installed. Liberica Full JDK 8 or later is recommended.
55+
Make sure you have Java 11 or later installed.
5656

5757
## JVM Options (for debugging)
5858

README_cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ HMCL 有着强大的跨平台能力。它不仅支持 Windows、Linux、macOS
4141
如果你想提交一个 Pull Request,必须遵守如下要求:
4242

4343
* IDE:IntelliJ IDEA
44-
* 编译器:Java 1.8 或 Java 11+
44+
* 编译器:Java 11+
4545
* **不要**修改 `gradle` 相关文件
4646

4747
### 编译
@@ -52,7 +52,7 @@ HMCL 有着强大的跨平台能力。它不仅支持 Windows、Linux、macOS
5252
./gradlew clean build
5353
```
5454

55-
请确保你至少安装了含有 JavaFX 8 的 Java。建议使用 Liberica Full JDK 8 或更高版本。
55+
请确保你至少安装了 JDK 11 或更高版本。
5656

5757
## JVM 选项 (用于调试)
5858

README_tw.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ HMCL 有著強大的跨平臺能力。它不僅支援 Windows、Linux、macOS
4141
如果你想提交一個 Pull Request,必須遵守如下要求:
4242

4343
* IDE:IntelliJ IDEA
44-
* 編譯器:Java 1.8 或 Java 11+
44+
* 編譯器:Java 11+
4545
* **不要**修改 `gradle` 相關文件
4646

4747
### 編譯
@@ -52,7 +52,7 @@ HMCL 有著強大的跨平臺能力。它不僅支援 Windows、Linux、macOS
5252
./gradlew clean build
5353
```
5454

55-
請確保你至少安裝了含有 JavaFX 8 的 Java。建議使用 Liberica Full JDK 8 或更高版本。
55+
請確保你至少安裝了 JDK 11 或更高版本。
5656

5757
## JVM 選項 (用於除錯)
5858

0 commit comments

Comments
 (0)