asked on
ProcessBuilder.command(String[])
instead of
ProcessBuilder.command(String)
would prevent the ProcessBuilder.exec from having troubles with splitting the command line, but it does not work. String[] cmd=new String[]{"java",
"-jar",
"mailer.jar"
"smtp.test.org",
"test@test.org",
"test@test.org",
"my subject ...",
"my content with carriage returns and other strange characters"};
String[] args=new String[]{
"smtp.test.org",
"test@test.org",
"test@test.org",
"my subject ...",
"my content with",
"carriage returns and",
"other strange characters",
...};
ASKER
private String[] escapeCMD(String[] commandLine) {
String[] escapedCmd = Arrays.copyOf(commandLine, commandLine.length);
for (int i = 0; i < escapedCmd.length; i++) {
escapedCmd[i] = escapedCmd[i].replace("\"", "\\\"").replace("'", "\\'");
}
return escapedCmd;
}
ASKER
Mailer.main(args);
ASKER
ASKER
java
-jar
mailer.jar
zimbra.xxxx.fr
ryyyyy@xxxx.fr
ryyyyy@xxxx.fr
NUMAILER[BOOT] RollbackSuccesfull -- satId=40436aff506a72aae8552438d493238b22d67581, path=C:/Program Files/Xxxx/Backup4, companyId=2
The install add to be rolled back.;Rollback reason was: XxxxException : The process terminated in error after 12ms, IExecutionResult[exitCode=1, stdOut="", stdErr=""] >>>> STACK TRACE :[fr.xxxx.boot.RuntimeBooter.bootRuntime(RuntimeBooter.java:125), fr.xxxx.boot.RuntimeBooter.run(RuntimeBooter.java:51), java.lang.Thread.run(Unknown Source)]
..\log, 25]
Arg[0] : zimbra.xxxx.fr
Arg[1] : ryyyyy@xxxx.fr
Arg[2] : ryyyyy@xxxx.fr
Arg[3] : NUMAILER[BOOT] RollbackSuccesfull -- satId=40436aff506a72aae8552438d493238b22d67581, path=C:/Program Files/Xxxx/Backup4, companyId=2
Arg[4] : The install add to be rolled back.;Rollback reason was: XxxxException : The process terminated in error after 17ms, IExecutionResult[exitCode=1, stdOut=",
Arg[5] : stdErr=Invalid or corrupt jarfile runtime-4.1.1.jar ;]
Arg[6] : >>>>
Arg[7] : STACK
Arg[8] : TRACE
Arg[9] : :[fr.xxxx.boot.RuntimeBooter.bootRuntime(RuntimeBooter.java:125),
Arg[10] : fr.xxxx.boot.RuntimeBooter.run(RuntimeBooter.java:51),
Arg[11] : java.lang.Thread.run(Unknown
Arg[12] : Source)] ..\log 25
ASKER
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.
TRUSTED BY