|
| 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. |
0 commit comments