For win32, it appears that java.lang.ProcessImpl is not performing quotation correctly for an argument of length zero. This affects the <java> target in ant when empty command line arguments are passed in. I have attached a short sample test that is runnable from ant. It calls a simple Java class and passes in some arguments. On unix, both tests pass, but on windows, it fails:
** fork=false **
Pass:
argument 0: "argument0"
argument 1: ""
argument 2: "argument2"
** fork=true **
Fail. Only received 2 args:
argument 0: "argument0"
argument 1: "argument2"
I don't think this is an ant issue, as it does not appear that ant converts all the arguments into a single string (as it would be on a command line).
Adding Kohsuke to the interest list since he did the detective work to narrow down the issue.
** fork=false **
Pass:
argument 0: "argument0"
argument 1: ""
argument 2: "argument2"
** fork=true **
Fail. Only received 2 args:
argument 0: "argument0"
argument 1: "argument2"
I don't think this is an ant issue, as it does not appear that ant converts all the arguments into a single string (as it would be on a command line).
Adding Kohsuke to the interest list since he did the detective work to narrow down the issue.
- duplicates
-
JDK-6599589 (process) Runtime.exec loses empty parameters on Windows
- Closed
-
JDK-7028124 ProcessBuilder doesn't handle empty command arguments
- Closed
- relates to
-
JDK-6468220 (process) Runtime.exec(String[]) does not pass command line arguments correctly (win)
- Closed
-
JDK-6511002 (process) Document the auto-quoting when creating a Windows process; add winQuote
- Closed