relauncher

relauncher

JVM relaunch library for Java based applications.

by
446 Downloads
fabricforgeneoforgequiltlibrarymanagementutility
Rent Server with this Mod

About this Mod

Relauncher

JVM relaunch library for Java based applications. Drop a single JAR into your mods folder,
and it should work from Minecraft 1.6.4 to the latest version, or on Hytale Server as an early plugin or regular plugin.

What it does

Relauncher restarts the JVM process with additional arguments transparently and before the game loads.
This is useful for:

  • Adding JVM flags - GC tuning, -XX:+AlwaysPreTouch, system properties, etc., without needing to touch launcher
    settings
  • Modpack tooling - other mods can trigger a relaunch programmatically after installing dependencies or configuring
    the environment (javaagents, module layers, you name it)

The relaunch happens very early during startup, before any significant game state is initialized.
External launchers see a single continuous process with no extra windows, no orphaned processes.

Supported Versions

Loader Minecraft Versions Entry Point
Forge (LaunchWrapper) 1.6.4 - 1.12.2 ITweaker via manifest
Forge (ModLauncher) 1.13.2+ ITransformationService via SPI
NeoForge (ModLauncher) up to 1.21.1 ITransformationService via SPI
NeoForge (FancyModLoader) 1.21.3+ IModFileCandidateLocator via SPI
Fabric 1.14+ PreLaunchEntrypoint via fabric.mod.json
Quilt 1.14+ Uses Fabric's PreLaunchEntrypoint
Hytale Server (early) - ClassTransformer SPI
Hytale Server (plugin) - JavaPlugin via manifest.json

Java versions: 8 through 25

Platforms: Linux, Windows, and macOS, on both x86_64 and aarch64.

Installation

  1. Download the universal JAR (relauncher-universal-<version>.jar)
  2. Drop it into your mods/ folder
  3. Launch the game once, it will create a config file at config/relauncher/config.cfg
  4. Edit the config to add your JVM arguments and set enabled = true
  5. Relaunch the game

Configuration

The config file is at <game directory>/config/relauncher/config.cfg:

# Relauncher Configuration
# Extra JVM arguments to add when relaunching, one per line.
# Lines starting with # are comments, blank lines are ignored.

# Set to false to disable relaunching without removing your arguments.
enabled = true

# Add extra JVM arguments below, one per line:
-XX:+UseG1GC
-XX:+AlwaysPreTouch
-Dsome.java.property=true

The config enabled flag only controls the config file's own arguments.
If another mod provides a CommandLineProvider SPI implementation, the relaunch will happen regardless of this flag.

How it works

Relauncher tries three strategies to restart the JVM, in order of preference:

  1. POSIX exec (Linux / macOS) - calls execvp() through a native Rust library to replace the current process
    in-place. Same PID, zero overhead, cleanest possible restart.

  2. Windows DLL - hooks DllMain(DLL_PROCESS_DETACH) to spawn a child process after the JVM has fully shut down.
    stdin/stdout/stderr are duplicated beforehand so they survive the teardown. The parent waits for the child and
    forwards its exit code.

  3. Fallback (pure Java) - starts a child process with inherited I/O, waits for it to finish, then halts. Works
    everywhere, but the original process sticks around for the duration of the game session.

Launcher Compatibility

Launcher Status
Vanilla Fully supported
PrismLauncher Fully supported (system properties workaround)
CurseForge Fully supported (delegates to vanilla)
Modrinth Fully supported (theseus wrapper workaround)
ATLauncher Fully supported
MultiMC Not supported - relies on a stdin protocol that can't be replayed after relaunch. A warning is logged and the relaunch is skipped. Consider switching launchers or applying the arguments manually.

For Mod Developers

API dependency

Add relauncher-core as a compile-only dependency - the universal JAR will be present at runtime:

dependencies {
    compileOnly 'com.juanmuscaria:relauncher-core:<version>'
}

Programmatic relaunch

If your mod needs to restart the JVM (e.g., after installing a javaagent), call Relauncher.relaunch() directly:

import com.juanmuscaria.relauncher.Relauncher;
import com.juanmuscaria.relauncher.RelaunchResult;

List<String> extraArgs = Arrays.asList("-Dfoo=bar", "-XX:+AlwaysPreTouch");
RelaunchResult result = Relauncher.relaunch(extraArgs);

// If we get here, the relaunch didn't happen
if (result.isFailed()) {
    logger.error("Relaunch failed: " + result.reason());
} else if (result.isSkipped()) {
    logger.warn("Relaunch skipped: " + result.reason());
}

SPI provider

You can also inject JVM arguments without calling the API directly, just implement CommandLineProvider and register it
via ServiceLoader.
Relauncher scans the mods folder for service files on its own, so your mod doesn't even need to be on the classpath yet.

import com.juanmuscaria.relauncher.CommandLineProvider;

public class MyProvider implements CommandLineProvider {
    @Override
    public List<String> extraJvmArguments() {
        return Collections.singletonList("-Dmy.mod.installed=true");
    }

    @Override
    public int priority() {
        return 0; // lower = runs first
    }
}

Register it in META-INF/services/com.juanmuscaria.relauncher.CommandLineProvider:

com.example.mymod.MyProvider

Checking relaunch state

Relauncher.isRelaunched()  // true if we're inside a relaunched JVM
Relauncher.getDepth()      // 0 = original, 1 = first relaunch, etc.

Debugging

Add -Drelauncher.debug=true to your launcher's JVM arguments. This logs the full command-line extraction,
argument assembly, and strategy selection process. Useful for figuring out why a relaunch isn't working the way you
expect.

Building from source

./gradlew build                           # Full build
./build-natives.sh                        # Cross-compile native libraries

You'll need Java 17+ (used as a toolchain; the output still targets Java 8) and Gradle 9.
For cross-compiling the native Rust libraries you'll also
need cross, cargo-xwin,
and cargo-zigbuild, and Zig toolchain.

License

Mozilla Public License 2.0

Available Versions

relauncher 1.1.0release
MC 1.6.4, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.10, 1.10.1, 1.10.2, 1.11, 1.11.1, 1.11.2, 1.12, 1.12.1, 1.12.2, 1.13, 1.13.1, 1.13.2, 1.14, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.15, 1.15.1, 1.15.2, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.17, 1.17.1, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2fabric, forge, neoforge, quilt
April 26, 2026
relauncher 1.0.0release
MC 1.6.4, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.10, 1.10.1, 1.10.2, 1.11, 1.11.1, 1.11.2, 1.12, 1.12.1, 1.12.2, 1.13, 1.13.1, 1.13.2, 1.14, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.15, 1.15.1, 1.15.2, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.17, 1.17.1, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11fabric, forge, neoforge, quilt
March 21, 2026

How to Install relauncher on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (26.1.2).

3

Install Mod

Open the mod browser in the dashboard and search for "relauncher". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabricforgeneoforgequilt

Minecraft Versions

26.1.2, 26.1.1, 26.1 (+80 more)

Server-side

~ Optional

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

relauncher server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (26.1.2). You can switch loaders with one click in the panel.

Is relauncher compatible with fabric and forge and neoforge and quilt?

relauncher officially supports fabric, forge, neoforge, quilt for Minecraft 26.1.2, 26.1.1, 26.1. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with relauncher – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if relauncher consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install relauncher with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
Mozilla Public License 2.0
Server-side
Optional

Supported Versions

26.1.226.1.126.11.21.111.21.101.21.91.21.81.21.71.21.61.21.5+73 more