Fast Java build tool with Groovy & Kotlin DSL support.
Quick Start
Extract forge-1.2.9.zip to a location (e.g., C:\Program Files\forge)
2. Run the Installer (Windows)
cd forge
install.bat
Required: Run as Administrator
3. Restart Your Terminal
Close and reopen Command Prompt/PowerShell
4. Verify Installation
forge version
What Gets Installed
The installer sets two environment variables:
- FORGE_HOME - Points to your Forge installation directory
- PATH - Adds
%FORGE_HOME%\bin so forge works globally
Manual Installation (Without Installer)
If you prefer to set environment variables manually:
Set FORGE_HOME to your Forge directory:
setx FORGE_HOME "C:\Program Files\forge"
Add to PATH:
setx PATH "%PATH%;%FORGE_HOME%\bin"
Restart your terminal
Directory Structure
forge/
├── bin/ # Scripts (add to PATH)
│ └── forge.cmd
├── lib/ # JAR files
│ └── forger-1.2.9.jar
├── docs/
│ └── README.md # This file
└── install.bat # Installation script
Usage
Basic Commands
forge build # Build the project
forge clean # Remove build/ directory
forge resolve # Show dependencies
forge version # Show version
forge help # Show help
Create a Build Config
Create build.forge or build.forge.kts in your project root:
Groovy DSL:
name = "MyProject"
version = "1.0.0"
dependencies {
add "com.google.code.gson:gson:2.10.1"
add "org.junit.jupiter:junit-jupiter-api:5.9.2"
}
repositories {
add "https://repo.maven.apache.org/maven2"
}
Kotlin DSL (build.forge.kts):
name("MyProject")
version("1.0.0")
dependencies {
add("com.google.code.gson:gson:2.10.1")
add("org.junit.jupiter:junit-jupiter-api:5.9.2")
}
repositories {
add("https://repo.maven.apache.org/maven2")
}
Project Structure
Forge expects this layout:
MyProject/
├── build.forge # Your build config
├── src/
│ └── main/
│ └── java/ # Your Java source code
│ └── me/
│ └── example/
│ └── Main.java
└── build/ # Generated by Forge
├── classes/ # Compiled files
└── libs/ # Dependencies
Requirements
- Java 21+ (OpenJDK recommended)
- Windows 7+ or compatible
Install Java
Download OpenJDK 21 from:
https://adoptium.net/
Then install and ensure java is in your PATH:
java -version
Environment Variables
FORGE_DEBUG
Enable debug output:
set FORGE_DEBUG=1
forge build
FORGE_HOME
Set to your Forge installation directory (automatic via installer):
echo %FORGE_HOME%
Troubleshooting
"forge is not recognized as an internal command"
Verify FORGE_HOME is set:
echo %FORGE_HOME%
Verify bin is in PATH:
echo %PATH%
If not set, run installer again:
%FORGE_HOME%\install.bat
"Java is not installed or not in PATH"
Install OpenJDK 21+:
https://adoptium.net/
Verify Java works:
java -version
javac -version
Build fails with "No build.forge found"
Create a build.forge or build.forge.kts file in your project root. See examples above.
"Compiled 0 Java files"
Ensure your Java files are in: src/main/java/
Package structure must match directory structure:
package com.example; → src/main/java/com/example/ClassName.java
Uninstall
To remove Forge from your system:
- Delete the Forge directory
- Remove
%FORGE_HOME%\bin from PATH:
- Search: "Environment Variables"
- Edit PATH and remove the Forge entry
- Delete the
FORGE_HOME variable
License
Forge uses MIT License