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()




On Aug 22, 2006, at 11:26 AM, Jha, Navin wrote:


Open -a "Applications/Adobe Photoshop CS2/Adobe Photoshop CS2.app" "/Users/administrator/myapp/tmp/{555}_01.jpg"


This is a relative path, probably from your user, if you use the same sort of path for java unless user.dir is your actual user directory this won't work.
You would need
{ "open","-a",new StringBuffer(System.getProperty("user.home")).append ("/Applications/Adobe Photoshop CS2/Adobe PhotoShop CS2.app").toString (),"/Users/administrator/myapp/tmp/{555}_01.jpg" }


if not the problem you might to try without the .app on the application I think working differently has been mentioned in the past.

fwiw, my application includes a runtime exec commandline command and this worked fine...

exec open -a Preview.app /Users/mjh/Pictures/12.gif

so, also maybe you don't need to qualify the application path. But it appears that what you are doing should work.
Maybe you were successfully finding and resolving the shortcut (alias?) but not directly finding the application for some path reason.




Mike Hall        mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Using Runtime.getRuntime().exec() (From: "Jha, Navin" <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.