Skip to content

Commit 5057524

Browse files
authored
更新 README.md (#5156)
1 parent c723acf commit 5057524

13 files changed

Lines changed: 410 additions & 390 deletions

docs/Building.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/Building_zh.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/Contributing.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Contributing Guide
2+
3+
<!-- #BEGIN LANGUAGE_SWITCHER -->
4+
**English** | [中文](Contributing_zh.md)
5+
<!-- #END LANGUAGE_SWITCHER -->
6+
7+
## Build HMCL
8+
9+
### Requirements
10+
11+
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).
12+
13+
After installing the JDK, make sure the `JAVA_HOME` environment variable points to the required JDK directory.
14+
You can check the JDK version that `JAVA_HOME` points to like this:
15+
16+
<details>
17+
<summary>Windows</summary>
18+
19+
PowerShell:
20+
21+
```
22+
PS > & "$env:JAVA_HOME/bin/java.exe" -version
23+
openjdk version "25" 2025-09-16 LTS
24+
OpenJDK Runtime Environment (build 25+37-LTS)
25+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
26+
```
27+
28+
</details>
29+
30+
<details>
31+
<summary>Linux/macOS/FreeBSD</summary>
32+
33+
```
34+
> $JAVA_HOME/bin/java -version
35+
openjdk version "25" 2025-09-16 LTS
36+
OpenJDK Runtime Environment (build 25+37-LTS)
37+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
38+
```
39+
40+
</details>
41+
42+
### Get HMCL Source Code
43+
44+
- You can get the latest source code via [Git](https://git-scm.com/downloads):
45+
```shell
46+
git clone https://github.com/HMCL-dev/HMCL.git
47+
cd HMCL
48+
```
49+
- You can manually download a specific version of the source code from the [GitHub Release page](https://github.com/HMCL-dev/HMCL/releases).
50+
51+
### Build HMCL
52+
53+
To build HMCL, switch to the root directory of the HMCL project and run the following command:
54+
55+
```shell
56+
./gradlew clean makeExecutables
57+
```
58+
59+
The built HMCL program files are located in the `HMCL/build/libs` subdirectory under the project root.
60+
61+
## Debug Options
62+
63+
> [!WARNING]
64+
> This document describes HMCL's internal features, which we do not guarantee to be stable and may be modified or removed at any time.
65+
>
66+
> Please use these features with caution, as improper use may cause HMCL to behave abnormally or even crash.
67+
68+
HMCL provides a series of debug options to control the behavior of the launcher.
69+
70+
These options can be specified via environment variables or JVM parameters. If both are present, JVM parameters will override the environment variable settings.
71+
72+
| Environment Variable | JVM Parameter | Function | Default Value | Additional Notes |
73+
|-----------------------------|----------------------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|---------------------------|
74+
| `HMCL_JAVA_HOME` | | Specifies the Java used to launch HMCL | | Only effective for exe/sh |
75+
| `HMCL_JAVA_OPTS` | | Specifies the default JVM parameters when launching HMCL | | Only effective for exe/sh |
76+
| `HMCL_FORCE_GPU` | | Specifies whether to force GPU-accelerated rendering | `false` | |
77+
| `HMCL_ANIMATION_FRAME_RATE` | | Specifies the animation frame rate of HMCL | `60` | |
78+
| `HMCL_LANGUAGE` | | Specifies the default language of HMCL | Uses the system default language | |
79+
| | `-Dhmcl.dir=<path>` | Specifies the current data folder of HMCL | `./.hmcl` | |
80+
| | `-Dhmcl.home=<path>` | Specifies the user data folder of HMCL | Windows: `%APPDATA\.hmcl`<br>Linux/BSD: `$XDG_DATA_HOME/hmcl`<br>macOS: `~Library/Application Support/hmcl` | |
81+
| | `-Dhmcl.self_integrity_check.disable=true` | Disables self-integrity checks during updates | | |
82+
| | `-Dhmcl.bmclapi.override=<url>` | Specifies the API Root for BMCLAPI | `https://bmclapi2.bangbang93.com` | |
83+
| | `-Dhmcl.discoapi.override=<url>` | Specifies the API Root for foojay Disco API | `https://api.foojay.io/disco/v3.0` | |
84+
| `HMCL_FONT` | `-Dhmcl.font.override=<font family>` | Specifies the default font for HMCL | Uses the system default font | |
85+
| | `-Dhmcl.update_source.override=<url>` | Specifies the update source for HMCL | `https://hmcl.huangyuhui.net/api/update_link` | |
86+
| | `-Dhmcl.authlibinjector.location=<path>` | Specifies the location of the authlib-injector JAR file | Uses the built-in authlib-injector | |
87+
| | `-Dhmcl.openjfx.repo=<maven repository url>` | Adds a custom Maven repository for downloading OpenJFX | | |
88+
| | `-Dhmcl.native.encoding=<encoding>` | Specifies the native encoding | Uses the system's native encoding | |
89+
| | `-Dhmcl.microsoft.auth.id=<App ID>` | Specifies the Microsoft OAuth App ID | Uses the built-in Microsoft OAuth App ID | |
90+
| | `-Dhmcl.microsoft.auth.secret=<App Secret>` | Specifies the Microsoft OAuth App Secret | Uses the built-in Microsoft OAuth App Secret | |
91+
| | `-Dhmcl.curseforge.apikey=<Api Key>` | Specifies the CurseForge API key | Uses the built-in CurseForge API key | |
92+
| | `-Dhmcl.native.backend=<auto/jna/none>` | Specifies the native backend used by HMCL | `auto` | |
93+
| | `-Dhmcl.hardware.fastfetch=<true/false>` | Specifies whether to use fastfetch for hardware detection | `true` | |
Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,63 @@
1-
# 调试选项
1+
# 贡献指南
2+
3+
<!-- #BEGIN LANGUAGE_SWITCHER -->
4+
[English](Contributing.md) | **中文**
5+
<!-- #END LANGUAGE_SWITCHER -->
6+
7+
## 构建 HMCL
8+
9+
### 环境需求
10+
11+
构建 HMCL 启动器需要安装 JDK 17 (或更高版本)。你可以从此处下载它: [Download Liberica JDK](https://bell-sw.com/pages/downloads/#jdk-25-lts)
12+
13+
在安装 JDK 后,请确保 `JAVA_HOME` 环境变量指向符合需求的 JDK 目录。
14+
你可以这样查看 `JAVA_HOME` 指向的 JDK 版本:
15+
16+
<details>
17+
<summary>Windows</summary>
18+
19+
PowerShell:
20+
```
21+
PS > & "$env:JAVA_HOME/bin/java.exe" -version
22+
openjdk version "25" 2025-09-16 LTS
23+
OpenJDK Runtime Environment (build 25+37-LTS)
24+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
25+
```
26+
27+
</details>
28+
29+
<details>
30+
<summary>Linux/macOS/FreeBSD</summary>
31+
32+
```
33+
> $JAVA_HOME/bin/java -version
34+
openjdk version "25" 2025-09-16 LTS
35+
OpenJDK Runtime Environment (build 25+37-LTS)
36+
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing)
37+
```
38+
39+
</details>
40+
41+
### 获取 HMCL 源码
42+
43+
- 通过 [Git](https://git-scm.com/downloads) 可以获取最新源码:
44+
```shell
45+
git clone https://github.com/HMCL-dev/HMCL.git
46+
cd HMCL
47+
```
48+
-[GitHub Release 页面](https://github.com/HMCL-dev/HMCL/releases)可以手动下载特定版本的源码。
49+
50+
### 构建 HMCL
51+
52+
想要构建 HMCL,请切换到 HMCL 项目的根目录下,并执行以下命令:
53+
54+
```shell
55+
./gradlew clean makeExecutables
56+
```
57+
58+
构建出的 HMCL 程序文件位于根目录下的 `HMCL/build/libs` 子目录中。
59+
60+
## 调试选项
261

362
> [!WARNING]
463
> 本文介绍的是 HMCL 的内部功能,我们不保证这些功能的稳定性,并且随时可能修改或删除这些功能。
@@ -32,9 +91,3 @@ HMCL 提供了一系列调试选项,用于控制启动器的行为。
3291
| | `-Dhmcl.native.backend=<auto/jna/none>` | 指定HMCL使用的本机后端 | `auto` |
3392
| | `-Dhmcl.hardware.fastfetch=<true/false>` | 指定是否使用 fastfetch 检测硬件信息 | `true` |
3493

35-
36-
37-
38-
39-
40-

0 commit comments

Comments
 (0)