MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / read_java_version

Function read_java_version

rust/src/jre.rs:329–337  ·  view source on GitHub ↗
(java_path: &Path)

Source from the content-addressed store, hash-verified

327}
328
329fn read_java_version(java_path: &Path) -> Result<Option<String>, Error> {
330 let output = Command::new(java_path).arg("-version").output()?;
331 let combined_output = format!(
332 "{}\n{}",
333 String::from_utf8_lossy(&output.stdout),
334 String::from_utf8_lossy(&output.stderr)
335 );
336 parse_java_version(&combined_output)
337}
338
339fn parse_java_version(output: &str) -> Result<Option<String>, Error> {
340 let re = Regex::new(r#"version\s+\"([^\"]+)\""#)?;

Callers 2

detect_system_javaFunction · 0.85
detect_managed_jreFunction · 0.85

Calls 1

parse_java_versionFunction · 0.85

Tested by

no test coverage detected