Relauncher: Smart JVM Restart Library for Minecraft

Relauncher for Minecraft automatically restarts the JVM with custom arguments, optimizing garbage collection and memory. Works with Forge, NeoForge, Fabric, and Quilt.

Download relauncher universal for Minecraft 1.16.3

Original name: relauncher universal

Minecraft: 1.16.3

Loaders: Fabric

FileVersionLoaderSize
relauncher-universal-1.0.0-curseforge.jar1.16.3Fabric42 КБDownload
relauncher-universal-1.1.0-curseforge.jar1.16.3Fabric97 КБDownload
relauncher-universal-1.1.1-curseforge.jar1.16.3Fabric94 КБDownload

Relauncher: Seamless JVM Restart for Minecraft

Every seasoned Minecraft player understands the delicate relationship between Java Virtual Machine arguments and game performance. Garbage collector tuning, heap allocation, system properties — these parameters often demand manual intervention in launcher settings. What if a mod could handle the entire process automatically, restarting the game with the correct flags without the user ever noticing? That is precisely the niche occupied by Relauncher, a compact yet formidable library engineered to work across a staggering range of Minecraft versions, from the ancient 1.6.4 builds to the latest releases.

The Core Purpose: Transparent JVM Process Management

Imagine assembling a complex modpack where certain mods require specific Java arguments that are inconvenient to configure in every individual launcher. Alternatively, consider a scenario where your mod must dynamically attach a javaagent after dependencies are resolved. Relauncher executes the JVM restart at the earliest possible stage of the boot sequence, before the game initializes its primary state. From the perspective of external launchers, the entire operation appears as a single, continuous process — no extra windows, no orphaned processes, no user-facing disruption. The player simply launches the game, and the internal magic unfolds silently.

Why a JVM Restart Matters

Standard launcher configurations often lock in JVM arguments at process start. Changing these parameters mid-session is impossible without terminating the game. Relauncher bypasses this limitation by performing a controlled process replacement. This enables modpack authors to ship optimized JVM settings directly within their mod files, ensuring consistent performance across different launchers and user setups. The library also facilitates advanced use cases such as hot-loading instrumentation agents or applying memory allocation tweaks that would otherwise require manual launcher edits.

Compatibility Matrix: Versions and Loaders

One of Relauncher's most compelling attributes is its extraordinary breadth of compatibility. The library supports Java versions 8 through 25 and operates seamlessly on Linux, Windows, and macOS, covering both x86_64 and aarch64 architectures. The mod loader support list is equally impressive:

  • Forge (LaunchWrapper) — versions 1.6.4 through 1.12.2, integrated via ITweaker
  • Forge (ModLauncher) — versions 1.13.2 and above, integrated via ITransformationService
  • NeoForge (ModLauncher) — up to version 1.21.1, similarly via SPI
  • NeoForge (FancyModLoader) — versions 1.21.3 and newer, using IModFileCandidateLocator
  • Fabric — versions 1.14 and above, via PreLaunchEntrypoint
  • Quilt — utilizing the Fabric entry point
  • Hytale Server — as an early plugin or standard plugin

This extensive compatibility matrix positions Relauncher as an indispensable asset for mod developers who need their projects to function flawlessly across diverse environments and launcher ecosystems.

Installation and Initial Configuration

The installation procedure is refreshingly straightforward. Download the universal JAR file, named in the format relauncher-universal-[version].jar, and place it into the mods/ folder. Upon the first game launch, Relauncher automatically generates a configuration file at config/relauncher/config.cfg. For users of the foxygame.net launcher, the process becomes even more streamlined: this modern launcher supports direct mod installation from its interface, eliminating the need for manual JAR copying and file tracking. A single game launch is all that is required to generate the initial configuration.

Step-by-Step Setup

To get started with Relauncher, follow these simple steps:

  1. Obtain the universal JAR file from the official distribution source
  2. Copy the JAR into your Minecraft instance's mods/ directory
  3. Launch the game once to allow Relauncher to generate its configuration file
  4. Open config/relauncher/config.cfg and adjust the JVM arguments as needed
  5. Restart the game to apply the new settings

For those wondering how to install the mod on alternative launchers, the procedure remains identical: place the JAR in the mods folder and launch. The library handles all version detection and loader integration automatically.

Configuration File Deep Dive

The config.cfg file presents a clean, readable format. Users can specify any additional JVM arguments, one per line. Comment lines begin with the hash symbol (#), and empty lines are ignored. The critical parameter, enabled = true, governs only the arguments defined in this file. If another mod provides a CommandLineProvider implementation, the restart occurs regardless of this flag's value.

A typical configuration might look like this:

# Relauncher Configuration
enabled = true
-XX:+UseG1GC
-XX:+AlwaysPreTouch
-Dsome.java.property=true

This flexibility enables users to activate experimental garbage collectors like ZGC or define custom system properties without ever touching launcher settings. The configuration system is designed to be intuitive enough for casual players while remaining powerful enough for advanced modpack engineers.

Launcher Compatibility Considerations

Relauncher demonstrates excellent compatibility with the majority of popular launchers, including Vanilla, PrismLauncher, CurseForge, Modrinth, and ATLauncher. The single notable exception is MultiMC, which employs a stdin protocol that cannot be faithfully reproduced after a process restart. In such cases, Relauncher logs a clear warning and gracefully skips the restart operation. Users encountering this limitation can either switch to a supported launcher or manually append the desired JVM arguments to their MultiMC instance settings.

Internal Architecture: Three Restart Strategies

The library employs three distinct restart strategies, prioritized by preference. On Linux and macOS, Relauncher utilizes a native POSIX exec operation through a Rust library, replacing the process in place while preserving the same PID — resulting in zero overhead. On Windows, a DLL integration spawns a child process at JVM termination, duplicating stdin, stdout, and stderr streams. If native methods are unavailable, a pure Java fallback using ProcessBuilder and waitFor takes over. This universal approach works everywhere but leaves the original process resident for the session's duration.

It is worth noting that the CurseForge edition excludes native libraries due to platform policies. On Windows, without manually adding the natives, command-line reconstruction may be slightly imprecise. Users requiring exact argument preservation on Windows should obtain the universal edition from the primary distribution channel.

Developer-Focused Features

Relauncher extends its friendliness to mod creators. The primary API is published on Maven Central, requiring only the dependency declaration compileOnly 'com.juanmuscaria:relauncher-core:[version]'. Programmatic restart invocation is achieved with a single line: Relauncher.relaunch(extraArgs). If the restart does not occur, the method returns a RelaunchResult object containing a descriptive reason.

For deeper integration, developers can implement the CommandLineProvider interface and register it via ServiceLoader. Relauncher automatically scans the mods folder and picks up custom arguments before the mod itself loads. Runtime state inspection is available through Relauncher.isRelaunched() and Relauncher.getDepth(). The debug flag -Drelauncher.debug=true outputs a comprehensive log of the entire process — an invaluable tool during troubleshooting.

Practical Use Cases and Scenarios

The applications for Relauncher extend far beyond simple garbage collection tuning. Consider a modpack that requires a specific Java agent for shader preprocessing — Relauncher can inject the agent during the restart phase. Performance-oriented players can enforce consistent memory allocation across different launchers. Server administrators can standardize JVM flags across distributed client installations. The library even supports nested restart scenarios, where multiple mods each contribute their own arguments through the CommandLineProvider system.

To download Relauncher: Seamless JVM Restart for Minecraft, users should visit the official project repository or the Modrinth page. The Relauncher: Seamless JVM Restart for Minecraft for Minecraft artifact is available in both universal and platform-specific editions, with the universal JAR being the recommended choice for most installations.

Conclusion

Relauncher stands as a meticulously engineered library that alleviates the persistent headache of JVM parameter management for both players and mod developers. It operates invisibly, supports nearly every conceivable Minecraft version and mod loader combination, and provides developers with a clean, well-documented API. Whether the goal is garbage collector optimization, automatic javaagent installation, or simply maintaining configuration consistency within a modpack, Relauncher handles the task with elegance and reliability. For anyone serious about modding or seeking maximum performance from their custom builds, this tool unquestionably deserves a permanent place in the mods folder.