-
Notifications
You must be signed in to change notification settings - Fork 776
添加详细构建指南 #4524
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
Glavo
wants to merge
2
commits into
HMCL-dev:main
Choose a base branch
from
Glavo:doc-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
添加详细构建指南 #4524
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 构建指南 | ||
|
||
## 环境需求 | ||
|
||
构建 HMCL 启动器需要安装 JDK 17 (或更高版本)。你可以从此处下载它: [Download Liberica JDK](https://bell-sw.com/pages/downloads/#jdk-25-lts)。 | ||
|
||
在安装 JDK 后,请确保 `JAVA_HOME` 环境变量指向符合需求的 JDK 目录。 | ||
你可以这样查看 `JAVA_HOME` 指向的 JDK 版本: | ||
|
||
<details> | ||
<summary>Windows</summary> | ||
|
||
PowerShell: | ||
``` | ||
PS > & "$env:JAVA_HOME/bin/java.exe" -version | ||
openjdk version "25" 2025-09-16 LTS | ||
OpenJDK Runtime Environment (build 25+37-LTS) | ||
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing) | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Linux/macOS/FreeBSD</summary> | ||
|
||
``` | ||
> $JAVA_HOME/bin/java -version | ||
openjdk version "25" 2025-09-16 LTS | ||
OpenJDK Runtime Environment (build 25+37-LTS) | ||
OpenJDK 64-Bit Server VM (build 25+37-LTS, mixed mode, sharing) | ||
``` | ||
|
||
</details> | ||
|
||
## 获取 HMCL 源码 | ||
|
||
- 通过 [Git](https://git-scm.com/downloads) 可以获取最新源码: | ||
```shell | ||
git clone https://github.com/HMCL-dev/HMCL.git | ||
cd HMCL | ||
``` | ||
- 从 [GitHub Release 页面](https://github.com/HMCL-dev/HMCL/releases)可以手动下载特定版本的源码。 | ||
|
||
## 构建 HMCL | ||
|
||
想要构建 HMCL,请切换到 HMCL 项目的根目录下,并执行以下命令: | ||
|
||
```shell | ||
./gradlew clean makeExecutables | ||
``` | ||
|
||
构建出的 HMCL 程序文件位于根目录下的 `HMCL/build/libs` 子目录中。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或许不用指定
#jdk-25-lts
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
附议。