You've already forked AstralRinth
forked from didirus/AstralRinth
18 lines
449 B
Rust
18 lines
449 B
Rust
use crate::launcher::LauncherError;
|
|
use std::process::Command;
|
|
|
|
|
|
pub fn check_java() -> Result<String, LauncherError> {
|
|
let child = Command::new("java")
|
|
.arg("-version")
|
|
.output()
|
|
.map_err(|inner| LauncherError::ProcessError {
|
|
inner,
|
|
process: "java".into(),
|
|
})?;
|
|
|
|
let output = String::from_utf8_lossy(&child.stderr);
|
|
let output = output.trim_matches('\"');
|
|
Ok(output.into())
|
|
}
|