#java #runtimes #system #detect #detecting #detector #environment

java-runtimes

A library for detecting java runtimes in current system

3 unstable releases

0.3.1 Oct 26, 2024
0.3.0 Oct 26, 2024
0.2.0 Oct 25, 2024

#1 in #runtimes

Download history 277/week @ 2024-10-21 60/week @ 2024-10-28 11/week @ 2024-11-04

348 downloads per month

Custom license

22KB
254 lines

Crates.io Documentation Source code

java-runtimes

java-runtimes is a rust library that provides functionality to detect java runtimes in current system.

Installation

cargo add java-runtimes

Usage

Detect Java runtime from environment variables

use java_runtimes::detector;

fn main() {
    let runtimes = detector::detect_java_in_environments();
    println!("Detected Java runtimes: {:?}", runtimes);
}

Detect Java runtimes recursively within multiple paths

use java_runtimes::detector;

fn main() {
    let runtimes = detector::detect_java_in_paths(&[
        "/usr".as_ref(),
        "/opt".as_ref(),
    ], 2);
    println!("Detected Java runtimes in multiple paths: {:?}", runtimes);
}

Dependencies

~3–11MB
~111K SLoC