lighty-java

Automatic Java Runtime Environment (JRE) management for Minecraft launchers with multi-distribution support.

Overview

lighty-java provides automated downloading, installation, and management of Java runtimes for Minecraft:

  • Automatic JRE Download - Download Java on-demand based on Minecraft version requirements

  • Multi-Distribution Support - Temurin, GraalVM, Zulu, and Liberica distributions

  • Cross-Platform - Windows, Linux, and macOS (x64 and ARM64)

  • Version Detection - Automatically detect required Java version for any Minecraft version

  • Progress Tracking - Real-time download and extraction progress via event system

Quick Start

[dependencies]
lighty-java = "0.8.6"

Basic Usage

use lighty_java::{JavaDistribution, jre_downloader};
use std::path::Path;

#[tokio::main]
async fn main() {
    let runtime_dir = Path::new("./runtimes");

    // Download Java 21 (Temurin distribution)
    let java_path = jre_downloader::jre_download(
        runtime_dir,
        &JavaDistribution::Temurin,
        &21,
        |current, total| {
            let percent = (current * 100) / total;
            println!("Download progress: {}%", percent);
        }
    ).await.unwrap();

    println!("Java installed at: {}", java_path.display());
}

Version Detection

Java Distributions

Distribution
Provider
Supported Versions
Best For

Temurin (Recommended)

Eclipse Adoptium

8, 11, 17, 21

General use, maximum compatibility

GraalVM

Oracle

17, 21

Modern Minecraft (1.17+), maximum performance

Zulu

Azul Systems

8, 11, 17, 21

Enterprise environments, certified deployments

Liberica

BellSoft

8, 11, 17, 21

Resource-constrained systems, lightweight deployments

Platform Support

Platform
Architecture
Temurin
GraalVM
Zulu
Liberica

Windows

x64

Windows

ARM64

Linux

x64

Linux

ARM64

macOS

x64

macOS

ARM64 (M1/M2)

Complete Example

Documentation

📚 Complete Documentationarrow-up-right

Guide
Description

Design and implementation details

Deep dive into each Java distribution

Download and installation process

Java process execution and I/O handling

Complete usage examples and patterns

License

MIT

Last updated