Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: exec problem is JDK 1.7.0_21 Date: Sun, 21 Apr 2013 08:26:31 +0300 Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de k/5NDFcPZrad48ZIhEHfngDZFaJ6SuX7rSlOW5DHpqQBZa9MUYTU93RF80 Cancel-Lock: sha1:/aE2s1wh+Phoz5w9CUILpVYk0Ms= 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:23544 Am 21.04.2013 01:03, schrieb Daniel Pitts: > The first element of the array is the process name, the *rest* of the > elements are each exactly one parameter. > > The documentation says some *programs* may tokenize the argument > themselves. If you are passing to such a program, then you need to use > exactly two element array. The documentation speaks of "operating systems where programs are expected to tokenize command line strings themselves". Windows is that type of operating systems. For that type of operating system, the list of strings shall contain exactly two elements. Here's the quote again: > a command, a list of strings which signifies the external program > file to be invoked and its arguments, if any. Which string lists > represent a valid operating system command is system-dependent. For > example, it is common for each conceptual argument to be an element > in this list, but there are operating systems where programs are > expected to tokenize command line strings themselves - on such a > system a Java implementation might require commands to contain > exactly two elements Source: http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html And in fact, I can confirm that ProcessBuilder passes the second element of the string list to the invoked external program - however only if the argument starts and ends with a quote. Regards, Sven