From 81a94faaf6c68fcf5cc6d39009b16e2eec7304ab Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 17 Nov 2021 21:57:51 +0700 Subject: [PATCH] [FIX] ServerWrapperSetup javaw.exe --- .../src/main/java/pro/gravit/utils/helper/IOHelper.java | 6 +++++- .../gravit/launcher/server/setup/ServerWrapperSetup.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java index 313945d3..ba16d237 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java @@ -430,11 +430,15 @@ public static Path resolveIncremental(Path dir, String name, String extension) { } public static Path resolveJavaBin(Path javaDir) { + return resolveJavaBin(javaDir, false); + } + + public static Path resolveJavaBin(Path javaDir, boolean isConsole) { // Get Java binaries path Path javaBinDir = (javaDir == null ? JVM_DIR : javaDir).resolve("bin"); // Verify has "javaw.exe" file - if (!LogHelper.isDebugEnabled()) { + if (!isConsole && !LogHelper.isDebugEnabled()) { Path javawExe = javaBinDir.resolve("javaw.exe"); if (isFile(javawExe)) return javawExe; diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java index 916d5f2d..ef95b185 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java @@ -100,7 +100,7 @@ public void run() throws Exception { writer.append("#!/bin/bash\n\n"); } writer.append("\""); - writer.append(IOHelper.resolveJavaBin(Paths.get(System.getProperty("java.home"))).toAbsolutePath().toString()); + writer.append(IOHelper.resolveJavaBin(Paths.get(System.getProperty("java.home")), true).toAbsolutePath().toString()); writer.append("\" "); if (mainClassName.contains("bungee")) { LogHelper.info("Found BungeeCord mainclass. Modules dir change to modules_srv");