Skip to content

Commit d90df22

Browse files
authored
添加详细构建指南 (#4524)
1 parent fd7f909 commit d90df22

File tree

10 files changed

+121
-57
lines changed

10 files changed

+121
-57
lines changed

docs/Building.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Build Guide
2+
3+
<!-- #BEGIN LANGUAGE_SWITCHER -->
4+
**English** | [中文](Building_zh.md)
5+
<!-- #END LANGUAGE_SWITCHER -->
6+
7+
## Requirements
8+
9+
To build the HMCL launcher, you need to install JDK 17 (or higher). You can download it here: [Download Liberica JDK](https://bell-sw.com/pages/downloads/#jdk-25-lts).
10+
11+
After installing the JDK, make sure the `JAVA_HOME` environment variable points to the required JDK directory.
12+
You can check the JDK version that `JAVA_HOME` points to like this:
13+
14+
<details>
15+
<summary>Windows</summary>
16+
17+
PowerShell:
18+
```
19+
PS > & "$env:JAVA_HOME/bin/java.exe" -version
20+
openjdk version "25" 2025-09-16 LTS
21+
OpenJDK Runtime Environment (build 25+37-LTS)
22+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
23+
```
24+
25+
</details>
26+
27+
<details>
28+
<summary>Linux/macOS/FreeBSD</summary>
29+
30+
```
31+
> $JAVA_HOME/bin/java -version
32+
openjdk version "25" 2025-09-16 LTS
33+
OpenJDK Runtime Environment (build 25+37-LTS)
34+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
35+
```
36+
37+
</details>
38+
39+
## Get HMCL Source Code
40+
41+
- You can get the latest source code via [Git](https://git-scm.com/downloads):
42+
```shell
43+
git clone https://github.com/HMCL-dev/HMCL.git
44+
cd HMCL
45+
```
46+
- You can manually download a specific version of the source code from the [GitHub Release page](https://github.com/HMCL-dev/HMCL/releases).
47+
48+
## Build HMCL
49+
50+
To build HMCL, switch to the root directory of the HMCL project and run the following command:
51+
52+
```shell
53+
./gradlew clean makeExecutables
54+
```
55+
56+
The built HMCL program files are located in the `HMCL/build/libs` subdirectory under the project root.

docs/Building_zh.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 构建指南
2+
3+
<!-- #BEGIN LANGUAGE_SWITCHER -->
4+
[English](Building.md) | **中文**
5+
<!-- #END LANGUAGE_SWITCHER -->
6+
7+
## 环境需求
8+
9+
构建 HMCL 启动器需要安装 JDK 17 (或更高版本)。你可以从此处下载它: [Download Liberica JDK](https://bell-sw.com/pages/downloads/#jdk-25-lts)
10+
11+
在安装 JDK 后,请确保 `JAVA_HOME` 环境变量指向符合需求的 JDK 目录。
12+
你可以这样查看 `JAVA_HOME` 指向的 JDK 版本:
13+
14+
<details>
15+
<summary>Windows</summary>
16+
17+
PowerShell:
18+
```
19+
PS > & "$env:JAVA_HOME/bin/java.exe" -version
20+
openjdk version "25" 2025-09-16 LTS
21+
OpenJDK Runtime Environment (build 25+37-LTS)
22+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
23+
```
24+
25+
</details>
26+
27+
<details>
28+
<summary>Linux/macOS/FreeBSD</summary>
29+
30+
```
31+
> $JAVA_HOME/bin/java -version
32+
openjdk version "25" 2025-09-16 LTS
33+
OpenJDK Runtime Environment (build 25+37-LTS)
34+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
35+
```
36+
37+
</details>
38+
39+
## 获取 HMCL 源码
40+
41+
- 通过 [Git](https://git-scm.com/downloads) 可以获取最新源码:
42+
```shell
43+
git clone https://github.com/HMCL-dev/HMCL.git
44+
cd HMCL
45+
```
46+
-[GitHub Release 页面](https://github.com/HMCL-dev/HMCL/releases)可以手动下载特定版本的源码。
47+
48+
## 构建 HMCL
49+
50+
想要构建 HMCL,请切换到 HMCL 项目的根目录下,并执行以下命令:
51+
52+
```shell
53+
./gradlew clean makeExecutables
54+
```
55+
56+
构建出的 HMCL 程序文件位于根目录下的 `HMCL/build/libs` 子目录中。

docs/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ If you want to submit a pull request, here are some requirements:
4949

5050
### Compilation
5151

52-
Simply execute the following command in the project root directory:
53-
54-
```bash
55-
./gradlew clean build
56-
```
57-
58-
Make sure you have Java 17 or later installed.
52+
See the [Build Guide](./Building.md) page.
5953

6054
## JVM Options (for debugging)
6155

docs/README_es.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ Si deseas enviar un pull request, aquí tienes algunos requisitos:
4242

4343
### Compilación
4444

45-
Simplemente ejecuta el siguiente comando en el directorio raíz del proyecto:
46-
47-
```bash
48-
./gradlew clean build
49-
```
50-
51-
Asegúrate de tener instalado Java 17 o una versión posterior.
45+
Consulta la página de la [Guía de compilación](./Building.md).
5246

5347
## Opciones de JVM (para depuración)
5448

docs/README_ja.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ HMCLが対応しているシステムやCPUアーキテクチャについては
4141

4242
### コンパイル方法
4343

44-
プロジェクトのルートディレクトリで次のコマンドを実行してください。
45-
46-
```bash
47-
./gradlew clean build
48-
```
49-
50-
Java 17以上がインストールされていることを確認してください。
44+
ビルド方法については、[ビルドガイド](./Building.md)ページをご覧ください。
5145

5246
## JVMオプション(デバッグ用)
5347

docs/README_lzh.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ HMCL 跨域甚廣。無論 Windows、Linux、macOS、FreeBSD 諸常見械綱,
4242

4343
### 編造
4444

45-
於項目之根目錄,執下列令:
46-
47-
```bash
48-
./gradlew clean build
49-
```
50-
51-
務必保汝已安裝爪哇十七或更高者。
45+
請觀[編造指南](./Building_zh.md)
5246

5347
## 爪哇虛機之通弦(以資勘誤)
5448

docs/README_ru.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ HMCL обладает отличной кроссплатформенность
4141

4242
### Сборка
4343

44-
Выполните следующую команду в корневой директории проекта:
45-
46-
```bash
47-
./gradlew clean build
48-
```
49-
50-
Убедитесь, что у вас установлена Java 17 или новее.
44+
См. страницу [Руководство по сборке](./Building.md).
5145

5246
## Параметры JVM (для отладки)
5347

docs/README_uk.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ HMCL має чудові кросплатформні можливості. Ві
4141

4242
### Компіляція
4343

44-
Просто виконайте наступну команду в кореневому каталозі проєкту:
45-
46-
```bash
47-
./gradlew clean build
48-
```
49-
50-
Переконайтеся, що у вас встановлено Java 17 або новішої версії.
44+
Дивіться сторінку [Посібник зі збірки](./Building.md).
5145

5246
## JVM Options (for debugging)
5347

docs/README_zh.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,9 @@ HMCL 有着强大的跨平台能力。它不仅支持 Windows、Linux、macOS、
4747
* IDE:IntelliJ IDEA
4848
* 编译器:Java 17+
4949

50-
### 编译
50+
### 构建 HMCL
5151

52-
于项目根文件夹执行以下命令:
53-
54-
```bash
55-
./gradlew clean build
56-
```
57-
58-
请确保你至少安装了 JDK 17 或更高版本。
52+
参见[构建指南](./Building_zh.md)页面。
5953

6054
## JVM 选项 (用于调试)
6155

docs/README_zh_Hant.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ HMCL 有著強大的跨平臺能力。它不僅支援 Windows、Linux、macOS、
4949

5050
### 編譯
5151

52-
於項目根目錄執行以下指令:
53-
54-
```bash
55-
./gradlew clean build
56-
```
57-
58-
請確保你至少安裝了 JDK 17 或更高版本。
52+
參閱[構建指南](./Building_zh.md)頁面。
5953

6054
## JVM 選項 (用於除錯)
6155

0 commit comments

Comments
 (0)