lighty-java

Crates.iolighty-java
lib.rslighty-java
version0.8.6
created_at2025-12-02 11:09:45.032163+00
updated_at2025-12-14 07:26:50.794652+00
descriptionJava runtime management for Lighty Launcher
homepagehttps://github.com/Lighty-Launcher/LightyLauncherLib
repositoryhttps://github.com/Lighty-Launcher/LightyLauncherLib
max_upload_size
id1961617
size97,356
Hamadi (Kalandi)

documentation

https://docs.rs/lighty-launcher

README

lighty-java

Java runtime management for LightyLauncher.

Note

This is an internal crate for the LightyLauncher ecosystem. Most users should use the main lighty-launcher crate instead.

Features

  • Automatic JRE Download: Download and install Java runtimes on demand
  • Multiple Distributions: Support for Temurin, GraalVM, Zulu, and Liberica
  • Version Detection: Detect required Java version for Minecraft
  • Cross-Platform: Windows, Linux, and macOS support

Usage

[dependencies]
lighty-java = "0.6.3"
use lighty_java::{JavaDistribution, jre_downloader};
use directories::ProjectDirs;

#[tokio::main]
async fn main() {
    let launcher_dir = ProjectDirs::from("com", "MyLauncher", "").unwrap();

    // Download Java 21 (Temurin)
    let java_path = jre_downloader::jre_download(
        21,
        JavaDistribution::Temurin,
        &launcher_dir
    ).await?;

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

Structure

lighty-java/
└── src/
    ├── lib.rs              # Module declarations and re-exports
    ├── distribution/       # Java distribution providers
    │   ├── mod.rs          # Distribution types and main API
    │   ├── api_models.rs   # API response structures
    │   ├── utils.rs        # Shared utilities
    │   └── providers/      # Individual distribution providers
    │       ├── temurin.rs  # Adoptium Temurin provider
    │       ├── graalvm.rs  # Oracle GraalVM provider
    │       ├── zulu.rs     # Azul Zulu provider
    │       └── liberica.rs # BellSoft Liberica provider
    ├── jre_downloader.rs   # Download and install JRE
    ├── runtime.rs          # Java version detection and validation
    └── errors.rs           # Error types for Java operations

Supported Distributions

Temurin (Recommended)

Eclipse Temurin - OpenJDK builds from the Adoptium project.

use lighty_java::JavaDistribution;

let distribution = JavaDistribution::Temurin;

Supported Versions: 8, 11, 17, 21 Best for: General use, maximum compatibility

GraalVM

GraalVM - High-performance JDK with advanced optimizations.

use lighty_java::JavaDistribution;

let distribution = JavaDistribution::GraalVM;

Supported Versions: 17, 21 Best for: Modern Minecraft versions (1.17+), maximum performance

Zulu

Azul Zulu - OpenJDK builds with enterprise support available.

use lighty_java::JavaDistribution;

let distribution = JavaDistribution::Zulu;

Supported Versions: 8, 11, 17, 21 Best for: Enterprise environments, certified builds

Liberica

BellSoft Liberica - Lightweight OpenJDK distribution.

use lighty_java::JavaDistribution;

let distribution = JavaDistribution::Liberica;

Supported Versions: 8, 11, 17, 21 Best for: Resource-constrained systems, lightweight deployments

Platform Support

Platform Architectures Status
Windows x64, ARM64 Tested
Linux x64, ARM64 Tested
macOS x64, ARM64 Tested

License

MIT

Links

Commit count: 0

cargo fmt