[FEATURE] May be fix old wrapper's

This commit is contained in:
Gravit 2020-04-12 20:58:00 +07:00
parent c438f08d7a
commit 4592aeea2d
2 changed files with 11 additions and 2 deletions

View file

@ -34,6 +34,7 @@ public class ClientLauncherProcess {
public Path executeFile; public Path executeFile;
public Path workDir; public Path workDir;
public Path javaDir; public Path javaDir;
public boolean useLegacyJavaClassPathProperty;
public boolean isStarted; public boolean isStarted;
private transient Process process; private transient Process process;
@ -103,9 +104,16 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException {
List<String> processArgs = new LinkedList<>(); List<String> processArgs = new LinkedList<>();
processArgs.add(executeFile.toString()); processArgs.add(executeFile.toString());
processArgs.addAll(jvmArgs); processArgs.addAll(jvmArgs);
processArgs.add("-cp");
//ADD CLASSPATH //ADD CLASSPATH
if(useLegacyJavaClassPathProperty)
{
processArgs.add("-Djava.class.path".concat(String.join(getPathSeparator(), systemClassPath)));
}
else
{
processArgs.add("-cp");
processArgs.add(String.join(getPathSeparator(), systemClassPath)); processArgs.add(String.join(getPathSeparator(), systemClassPath));
}
processArgs.add(mainClass); processArgs.add(mainClass);
processArgs.addAll(systemClientArgs); processArgs.addAll(systemClientArgs);
synchronized (waitWriteParams) { synchronized (waitWriteParams) {

View file

@ -34,6 +34,7 @@ public void applyGuardParams(ClientLauncherProcess process) {
String projectName = Launcher.getConfig().projectName; String projectName = Launcher.getConfig().projectName;
String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe"); String wrapperUnpackName = JVMHelper.JVM_BITS == 64 ? projectName.concat("64.exe") : projectName.concat("32.exe");
process.executeFile = DirBridge.getGuardDir().resolve(wrapperUnpackName); process.executeFile = DirBridge.getGuardDir().resolve(wrapperUnpackName);
process.useLegacyJavaClassPathProperty = true;
} }
} }
} }