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.