Crates.io | java-runtimes |
lib.rs | java-runtimes |
version | 0.3.1 |
source | src |
created_at | 2024-10-25 16:28:44.423998 |
updated_at | 2024-10-26 11:16:18.338995 |
description | A library for detecting java runtimes in current system. |
homepage | |
repository | https://github.com/Leawind/java-runtimes |
max_upload_size | |
id | 1422710 |
size | 22,409 |
Crates.io | Documentation | Source code |
---|
java-runtimes
is a rust library that provides functionality to detect java runtimes in current system.
cargo add java-runtimes
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);
}