Skip to main content

locate_jvm_dyn_library

Function locate_jvm_dyn_library 

Source
pub fn locate_jvm_dyn_library() -> Result<String>
Expand description

Locates the JVM dynamic library directory.

Searches for the JVM dynamic library (jvm.dll, libjvm.dylib, or libjvm.so) within the Java installation directory.

§Returns

  • Ok(String) containing the directory path where the JVM library is located
  • Err(JavaLocatorError) if the JVM library cannot be found

§Examples

use java_manager;

fn main() -> java_manager::Result<()> {
    let jvm_lib_path = java_manager::locate_jvm_dyn_library()?;
    println!("JVM library directory: {}", jvm_lib_path);
    Ok(())
}