Skip to main content

get_java_home

Function get_java_home 

Source
pub fn get_java_home() -> Result<JavaInfo>
Expand description

Gets detailed information about the current Java installation.

This function locates the Java home directory and creates a comprehensive JavaInfo object with all available information about the installation.

§Returns

  • Ok(JavaInfo) containing detailed Java information
  • Err(JavaLocatorError) if Java cannot be located or information cannot be gathered

§Examples

use java_manager;

fn main() -> java_manager::Result<()> {
    let java_info = java_manager::get_local_java_home()?;
    println!("Current Java: {}", java_info);
    println!("Version: {}", java_info.version);
    println!("Architecture: {}", java_info.architecture);
    println!("Supplier: {}", java_info.suppliers);
    Ok(())
}