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).
After installing the JDK, make sure the `JAVA_HOME` environment variable points to the required JDK directory.
You can check the JDK version that `JAVA_HOME` points to like this:
<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)
- You can get the latest source code via [Git](https://git-scm.com/downloads):
```shell
git clone https://github.com/HMCL-dev/HMCL.git
cd HMCL
```
- You can manually download a specific version of the source code from the [GitHub Release page](https://github.com/HMCL-dev/HMCL/releases).
### Build HMCL
To build HMCL, switch to the root directory of the HMCL project and run the following command:
```shell
./gradlew clean makeExecutables
```
The built HMCL program files are located in the `HMCL/build/libs` subdirectory under the project root.
## Debug Options
> [!WARNING]
> This document describes HMCL's internal features, which we do not guarantee to be stable and may be modified or removed at any time.
>
> Please use these features with caution, as improper use may cause HMCL to behave abnormally or even crash.
HMCL provides a series of debug options to control the behavior of the launcher.
These options can be specified via environment variables or JVM parameters. If both are present, JVM parameters will override the environment variable settings.
| Environment Variable | JVM Parameter | Function | Default Value | Additional Notes |
| | `-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` | |