From 476bdb00e00bae6a0b05c4d25588b856c9547832 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 23 Apr 2012 18:32:26 +0300 Subject: [PATCH] INT-2533: polishing --- .../integration/gemfire/fork/ForkUtil.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/fork/ForkUtil.java b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/fork/ForkUtil.java index a38e0a3660..ea0f580b1c 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/fork/ForkUtil.java +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/fork/ForkUtil.java @@ -40,20 +40,19 @@ public class ForkUtil { String home = System.getProperty("java.home"); Process proc = null; - String java = home + "/bin/java ".replace("\\", "/"); - ; - String argCp = "-cp \"" + cp + "\""; + String java = home + "/bin/java".replace("\\", "/"); + String argClass = argument; - String cmd = java + argCp + " " + argClass; + String[] cmdArray = {java, "-cp", cp, argClass}; try { // ProcessBuilder builder = new ProcessBuilder(cmd, argCp, // argClass); // builder.redirectErrorStream(true); - proc = Runtime.getRuntime().exec(cmd); + proc = Runtime.getRuntime().exec(cmdArray); } catch (IOException ioe) { - throw new IllegalStateException("Cannot start command " + cmd, ioe); + throw new IllegalStateException("Cannot start command " + cmdArray, ioe); } System.out.println("Started fork");