Skip to main content

quick_search

Function quick_search 

Source
pub fn quick_search() -> Result<Vec<JavaInfo>, JavaError>
Expand description

Searches for Java installations by scanning every directory in $PATH.

This is the fastest search method — it only checks what is immediately available on the system PATH. On Windows it looks for java.exe; on Linux and macOS it looks for java.

§Returns

A Vec<JavaInfo> for every valid java executable found in PATH.

§Errors

Returns JavaError::IoError if a file-system operation fails when inspecting a candidate path. Individual invalid or unreadable paths are skipped silently.

§Example

use java_manager::quick_search;

let javas = quick_search()?;
for java in javas {
    println!("{} at {}", java.version, java.path.display());
}