Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-15?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: exec problem is JDK 1.7.0_21 Date: Sun, 21 Apr 2013 23:23:48 +0300 Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de nGC08HUFuf4uvHzs8YH9nwhXbqY9t/BZOomFKXy+NrTTFJspMu6rJ/90yk Cancel-Lock: sha1:0UjZAAPbzvU5OI372M9Zw17zD6g= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:23557 Am 21.04.2013 16:30, schrieb Chris Uppal: > Or, to put it another way: the only way to find out what works is to experiment > (it probably depends on the application you're launching as well as the OS and > Java platform). A right pain in the bum... So I experimented. I found, that using a list of arguments works just fine, unless these arguments contain quotes, spaces, or the empty string is one of the arguments. I found, that ProcessBuilder (as well as Runtime.exec) do a VERY BAD job at converting the argument array to something, that CommandLineToArgv would tokenize back into something close to what the argument array was. At the same time, ProcessBuilder doesn't give me full control over the command line parameter string. Instead, it sometimes adds quotes - but not in all cases that would require them. Also any of that is undocumented, such that any workaround I implement may or may not break in the future. Also, some here think that documentation as vague as "on some operating systems, something MIGHT be required" would actually contain a concrete statement about how to use ProcessBuilder on Windows. (Claiming, that this statement does not apply to Windows is just as bad as the opposite.) Regards, Sven