From 4592aeea2ded08244f7452ed6095c93938a98d14 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 12 Apr 2020 20:58:00 +0700 Subject: [PATCH] [FEATURE] May be fix old wrapper's --- .../launcher/client/ClientLauncherProcess.java | 12 ++++++++++-- .../gravit/launcher/guard/LauncherWrapperGuard.java | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java index 24a4bd0c..ea859503 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java @@ -34,6 +34,7 @@ public class ClientLauncherProcess { public Path executeFile; public Path workDir; public Path javaDir; + public boolean useLegacyJavaClassPathProperty; public boolean isStarted; private transient Process process; @@ -103,9 +104,16 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException { List processArgs = new LinkedList<>(); processArgs.add(executeFile.toString()); processArgs.addAll(jvmArgs); - processArgs.add("-cp"); //ADD CLASSPATH - processArgs.add(String.join(getPathSeparator(), systemClassPath)); + if(useLegacyJavaClassPathProperty) + { + processArgs.add("-Djava.class.path".concat(String.join(getPathSeparator(), systemClassPath))); + } + else + { + processArgs.add("-cp"); + processArgs.add(String.join(getPathSeparator(), systemClassPath)); + } processArgs.add(mainClass); processArgs.addAll(systemClientArgs); synchronized (waitWriteParams) { diff --git a/Launcher/src/main/java/pro/gravit/launcher/guard/LauncherWrapperGuard.java b/Launcher/src/main/java/pro/gravit/launcher/guard/LauncherWrapperGuard.java index 22c10b02..762449a6 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/guard/LauncherWrapperGuard.java +++ b/Launcher/src/main/java/pro/gravit/launcher/guard/LauncherWrapperGuard.java @@ -34,6 +34,7 @@ public void applyGuardParams(ClientLauncherProcess process) { String projectName = Launcher.getConfig().projectName; String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe"); process.executeFile = DirBridge.getGuardDir().resolve(wrapperUnpackName); + process.useLegacyJavaClassPathProperty = true; } } }