sufumi/JHR/docs
JHRJava

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

powershell
jhr --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

powershell
jhr --help

Build from source

bash
git clone https://github.com/JasnRathore/jhr cd jhr
powershell
buildjar.ps1

This produces target/jhr.jar and the target/jhr launcher script.

powershell
buildexe.ps1

This produces release/jhr.exe and the required files in release

powershell
cd release ./jhr.exe --help
03

Quick Start

From your Java project directory, initialize a config file and start JHR:

bash
jhr init
ini
root = src main_class = com.example.Main classpath = src delay = 1000
bash
jhr
04

Configuration

KeyDefaultDescription
rootsrcSource directory to watch
watch_dirs.Comma-separated subdirectories to watch
watch_exts.javaFile extensions that trigger rebuild
exclude_dirs.git,tmp,vendor,target,buildDirectories to ignore
main_classDemoFully-qualified main class to run
classpathsrcClasspath for javac/java
javac_flags(empty)Extra javac flags
jvm_args(empty)JVM flags like -Xmx
delay1000Debounce delay in ms
build_cmd(empty)Optional custom build command
log_levelinfodebug | info | warn | error
TipUse build_cmd for multi-module projects that need custom build steps.
05

Commands

CommandDescription
jhrStart hot-reload using .jhr.conf
jhr initGenerate a default .jhr.conf
jhr versionPrint version info
jhr helpShow 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.
Found an error? Docs are open source.Edit on GitHub