Java Hot Reload / docs
Save. Recompile. Restart. Automatically.
01
Overview
JHR (Java Hot Reload) watches your source tree, recompiles when .java files change, and restarts your program automatically. It is designed for tight feedback loops during development.
InfoJHR uses javac/java directly and shows a desktop overlay window whenever compilation fails.
What it does
- Watches your source directory with debouncing to avoid rebuild storms.
- Compiles updated files with javac on every save.
- Restarts the running process so changes are reflected immediately.
- Shows errors in an always-on-top Swing overlay window.
02
Installation
Download Release Setup
Download the latest release Setup
Download latest releaseFile: JavaHotReloaderSetup.exe
- Run the installer and follow the prompts
Run the binary
powershelljhr --help
Download Release Binary
Download the latest release ZIP
Download latest releaseFile: JavaHotReloader.zip
- Extract the files into a folder
- Add the folder to your PATH
Run the binary
powershelljhr --help
Build from source
bashgit clone https://github.com/JasnRathore/jhr cd jhr
powershellbuildjar.ps1
This produces target/jhr.jar and the target/jhr launcher script.
powershellbuildexe.ps1
This produces release/jhr.exe and the required files in release
powershellcd release ./jhr.exe --help
03
Quick Start
From your Java project directory, initialize a config file and start JHR:
bashjhr init
iniroot = src main_class = com.example.Main classpath = src delay = 1000
bashjhr
04
Configuration
| Key | Default | Description |
|---|---|---|
| root | src | Source directory to watch |
| watch_dirs | . | Comma-separated subdirectories to watch |
| watch_exts | .java | File extensions that trigger rebuild |
| exclude_dirs | .git,tmp,vendor,target,build | Directories to ignore |
| main_class | Demo | Fully-qualified main class to run |
| classpath | src | Classpath for javac/java |
| javac_flags | (empty) | Extra javac flags |
| jvm_args | (empty) | JVM flags like -Xmx |
| delay | 1000 | Debounce delay in ms |
| build_cmd | (empty) | Optional custom build command |
| log_level | info | debug | info | warn | error |
TipUse build_cmd for multi-module projects that need custom build steps.
05
Commands
| Command | Description |
|---|---|
| jhr | Start hot-reload using .jhr.conf |
| jhr init | Generate a default .jhr.conf |
| jhr version | Print version info |
| jhr help | Show usage |
06
Error Overlay
When compilation fails, JHR opens an always-on-top Swing window with the full javac output. Once you fix the error and save, the overlay dismisses automatically.
- Shows the file and line that failed to compile.
- Displays full stderr output in a scrollable panel.
- Auto-hides on the next successful rebuild.