Skip to main content

deep_search

Function deep_search 

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

Performs a deep search for Java installations using platform‑specific tools.

On Windows, this function uses the Everything SDK to search for java.exe files (excluding the C:\Windows directory). It requires the Everything search engine to be installed and running.

On Linux, it walks through common installation directories (/usr/lib/jvm, /usr/java, /opt, /usr/local) and looks for executable files named java. Symbolic links are followed.

§Errors

On Windows, returns JavaError::ExecuteError if the Everything database is not loaded or if Everything is not running.

On Linux, this function does not produce errors from the search itself, but individual JavaInfo::new calls may fail; such failures are ignored.

§Returns

A Vec<JavaInfo> containing all valid Java installations found.

§Examples

use java_manager::deep_search;

let javas = deep_search()?;
for java in javas {
    println!("Deep search found Java at {}", java.path.display());
}