Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Runtime.getRuntime().exec()



Jha, Navin wrote:

>I am running into a problem launching Photoshop from my application. I
>use the following String to launch Photoshop along with an image using
>exec().
>
>Open -a "Applications/Adobe Photoshop CS2/Adobe Photoshop CS2.app"
>"/Users/administrator/myapp/tmp/{555}_01.jpg"

Runtime.exec() is not a shell.  The single-String forms do not parse quotes.

You should use the String[] forms, with each arg in a separate String.  If
it still doesn't work, post the exact Java code you're using.

See the API docs for Runtime's single-String exec() methods.  They don't
directly say "quotes are not parsed".  Instead, they mention a default
StringTokenizer.  You must then read the API docs for StringTokenizer to
realize that it doesn't parse quotes.  Or you could search the list
archives for exec, because this is a fairly common question.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.