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");