Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: (java.lang.Runtime()).exec(new String[]) ... Date: Fri, 9 Dec 2011 23:00:01 -0800 (PST) Organization: http://groups.google.com Lines: 27 Message-ID: <29544146.1320.1323500401535.JavaMail.geo-discussion-forums@prkz16> References: <1322956063.644169@nntp.aceinnovative.com> <1323496863.17965@nntp.aceinnovative.com> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1323500402 30500 127.0.0.1 (10 Dec 2011 07:00:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 10 Dec 2011 07:00:02 +0000 (UTC) In-Reply-To: <1323496863.17965@nntp.aceinnovative.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10641 (unknown) wrote: > Something like this: Not too very like, I think - > Process proc = (java.lang.Runtime()).exec((new String[]{"ls", "-l", "/media/sda1/Physical_Basis.flv"})); > ~ > works just fine. except that it won't compile, as Stefan hinted. > Why doesn't something like, say: > ~ > Process proc = (java.lang.Runtime()).exec((new String[]{"date;", "time","ls", "-l", "/media/sda1/Physical_Basis.flv;", "date;"})); > ~ > work? For starters, for the same reason the other one doesn't. Please reply with a copy-and-paste of the output from 'javac' on these idioms, placed into an SSCCE, of course. A minor point unrelated to your major question - you never have to specify 'java.lang' for the types in that package. Just 'Runtime' will do nicely, thank you. -- Lew