Skip to content

Commit

Permalink
Fixed the path of the JRE on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Jun 3, 2023
1 parent c62a49b commit 3c4930b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src-tauri/src/minecraft/java/jre_downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ pub async fn find_java_binary(runtimes_folder: &Path, jre_version: u32) -> Resul
let mut files = fs::read_dir(&runtime_path).await?;

if let Some(jre_folder) = files.next_entry().await? {
let jre_bin = jre_folder.path().join("bin");
let folder_path = jre_folder.path();

let java_binary = match OS {
OperatingSystem::WINDOWS => jre_bin.join("javaw.exe"),
_ => jre_bin.join("java")
OperatingSystem::WINDOWS => {
folder_path.join("bin").join("javaw.exe")
}
OperatingSystem::OSX => {
folder_path.join("Contents").join("Home").join("bin").join("java")
}
_ => {
folder_path.join("bin").join("java")
}
};

if java_binary.exists() {
Expand Down

0 comments on commit 3c4930b

Please sign in to comment.