From df54f665c3fa3fb28079f871a0835a4d610cd7f7 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Sun, 27 Aug 2023 11:38:05 +0200 Subject: [PATCH] Fix for linux (and possibily macos) with java exec incorrect filename --- src/server/minecraft.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/minecraft.js b/src/server/minecraft.js index 802ef54..53dfc84 100644 --- a/src/server/minecraft.js +++ b/src/server/minecraft.js @@ -320,10 +320,10 @@ class Minecraft { resolve(join(jre, "bin", filename)) } else { logger.warn(`java sha256sum ${sha1} don't correspond to ${infos.sha256sum}`) - await this.downloadAndExtractJava(infos, downloadFolder, runtime).then(() => resolve(join(jre, "bin", "java.exe"))).catch(err => reject(err)) + await this.downloadAndExtractJava(infos, downloadFolder, runtime).then(() => resolve(join(jre, "bin", process.platform === "win32" ? "java.exe" : "java"))).catch(err => reject(err)) } } else { - await this.downloadAndExtractJava(infos, downloadFolder, runtime).then(() => resolve(join(jre, "bin", "java.exe"))).catch(err => reject(err)) + await this.downloadAndExtractJava(infos, downloadFolder, runtime).then(() => resolve(join(jre, "bin", process.platform === "win32" ? "java.exe" : "java"))).catch(err => reject(err)) } event.sender.send("progress", {type: "java", task: 1, total: 1 }) } else {