Module detector

Source
Expand description

This module provides functions for detecting available Java runtimes from given path(s).

The detected java runtimes are represented by the JavaRuntime struct.

§Examples

Detect Java runtime from environment variables

use java_runtimes::detector;

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

Detect Java runtimes recursively within a path

use java_runtimes::detector;

let runtimes = detector::detect_java("/usr".as_ref(), 2);
println!("Detected Java runtimes: {:?}", runtimes);

Detect Java runtimes recursively within multiple paths

use java_runtimes::detector;

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

Functions§

detect_java
Detects available Java runtimes within the specified path up to a maximum depth.
detect_java_bin_dir
Attempts to detect a Java runtime from the given directory path.
detect_java_exe
Attempts to detect a Java runtime from the given path.
detect_java_home_dir
Attempts to detect a Java runtime from the given Java home directory path.
detect_java_in_environments
Detects available Java runtimes from environment variables.
detect_java_in_paths
Detects available Java runtimes within multiple paths up to a maximum depth.
gather_java
Detects available Java runtimes within the specified path and appends them to the given vector.
gather_java_in_paths
Detects available Java runtimes within multiple paths up to a maximum depth and appends them to the given vector.