Skip to content

将构建项目所需的最低 JDK 版本升级至 11 #3805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/check-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-package: 'jdk+fx'
- name: Check style main
run: ./gradlew checkstyleMain --no-daemon
env:
JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
- name: Check style test
run: ./gradlew checkstyleTest --no-daemon
env:
JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
8 changes: 2 additions & 6 deletions .github/workflows/check-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-package: 'jdk+fx'
- name: Check style test
run: ./gradlew checkTranslations --no-daemon
env:
JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
7 changes: 1 addition & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
java-package: 'jdk+fx'
- name: Build with Gradle
run: ./gradlew build --no-daemon
env:
JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
MICROSOFT_AUTH_ID: ${{ secrets.MICROSOFT_AUTH_ID }}
MICROSOFT_AUTH_SECRET: ${{ secrets.MICROSOFT_AUTH_SECRET }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
Expand Down
5 changes: 0 additions & 5 deletions HMCL/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ val java11 = sourceSets.create("java11") {
}

tasks.getByName<JavaCompile>(java11.compileJavaTaskName) {
if (JavaVersion.current() < JavaVersion.VERSION_11) {
javaCompiler.set(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(11))
})
}
options.compilerArgs.add("--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED")
sourceCompatibility = "11"
targetCompatibility = "11"
Expand Down
6 changes: 0 additions & 6 deletions HMCLCore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ dependencies {
api("org.apache.commons:commons-compress:1.25.0")
api("org.jsoup:jsoup:1.18.3")
compileOnlyApi("org.jetbrains:annotations:26.0.1")

if (JavaVersion.current().isJava8) {
org.gradle.internal.jvm.Jvm.current().toolsJar?.let {
compileOnly(files(it))
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The software is distributed under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.h
If you want to submit a pull request, here are some requirements:

* IDE: IntelliJ IDEA
* Compiler: Java 1.8 or Java 11+
* Compiler: Java 11+
* Do NOT modify `gradle` files

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

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

## JVM Options (for debugging)

Expand Down
4 changes: 2 additions & 2 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ HMCL 有着强大的跨平台能力。它不仅支持 Windows、Linux、macOS
如果你想提交一个 Pull Request,必须遵守如下要求:

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

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

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

## JVM 选项 (用于调试)

Expand Down
4 changes: 2 additions & 2 deletions README_tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ HMCL 有著強大的跨平臺能力。它不僅支援 Windows、Linux、macOS
如果你想提交一個 Pull Request,必須遵守如下要求:

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

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

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

## JVM 選項 (用於除錯)

Expand Down