425736 - jetty-start / Jetty 9 fails to startup with --exec option if Java path contain
+ Using .addRawArg() to avoid space escaping for Java Bin
This commit is contained in:
parent
76d365677a
commit
f3d312698f
|
@ -192,4 +192,19 @@ public class CommandLineBuilder
|
|||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public void debug()
|
||||
{
|
||||
if (!StartLog.isDebugEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int len = args.size();
|
||||
StartLog.debug("Command Line: %,d entries",args.size());
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
StartLog.debug(" [%d]: \"%s\"",i,args.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -687,6 +687,7 @@ public class Main
|
|||
if (args.isExec())
|
||||
{
|
||||
CommandLineBuilder cmd = args.getMainArgs(baseHome,true);
|
||||
cmd.debug();
|
||||
ProcessBuilder pbuilder = new ProcessBuilder(cmd.getArgs());
|
||||
final Process process = pbuilder.start();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread()
|
||||
|
|
|
@ -408,11 +408,11 @@ public class StartArgs
|
|||
|
||||
if (addJavaInit)
|
||||
{
|
||||
cmd.addArg(CommandLineBuilder.findJavaBin());
|
||||
cmd.addRawArg(CommandLineBuilder.findJavaBin());
|
||||
|
||||
for (String x : jvmArgs)
|
||||
{
|
||||
cmd.addArg(x);
|
||||
cmd.addRawArg(x);
|
||||
}
|
||||
|
||||
cmd.addRawArg("-Djetty.home=" + baseHome.getHome());
|
||||
|
@ -425,7 +425,7 @@ public class StartArgs
|
|||
cmd.addEqualsArg("-D" + propKey,value);
|
||||
}
|
||||
|
||||
cmd.addArg("-cp");
|
||||
cmd.addRawArg("-cp");
|
||||
cmd.addRawArg(classpath.toString());
|
||||
cmd.addRawArg(getMainClassname());
|
||||
}
|
||||
|
@ -447,7 +447,7 @@ public class StartArgs
|
|||
{
|
||||
properties.store(out,"start.jar properties");
|
||||
}
|
||||
cmd.addArg(prop_file.getAbsolutePath());
|
||||
cmd.addRawArg(prop_file.getAbsolutePath());
|
||||
}
|
||||
|
||||
for (File xml : xmls)
|
||||
|
|
Loading…
Reference in New Issue