diff --git a/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java b/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java index 7871bd2ce2f5e5a985a967f0c157a0960585de7e..4534a8fe2f6359f05c414ded16659f9036fa9e97 100644 --- a/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java +++ b/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java @@ -100,7 +100,7 @@ public class JDKToolLauncher { * @return The JDKToolLauncher instance */ public JDKToolLauncher addVMArg(String arg) { - vmArgs.add("-J" + arg); + vmArgs.add(arg); return this; } @@ -124,7 +124,10 @@ public class JDKToolLauncher { public String[] getCommand() { List command = new ArrayList(); command.add(executable); - command.addAll(vmArgs); + // Add -J in front of all vmArgs + for (String arg : vmArgs) { + command.add("-J" + arg); + } command.addAll(toolArgs); return command.toArray(new String[command.size()]); }