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: finding & launching MS-Excel from java



Alain Ravet wrote:

>So, all it takes on MacOS X is:
>  Runtime.getRuntime ().exec ("open /Users/me/file.xls ");

First, you should use the String[] form of exec().  If the file's pathname
happens to have a space-character in it, the single-String form will fail
badly.  Read the API docs for exec() and StringTokenizer.

Second, if everything works, then you don't need to do anything else.  But
if Excel isn't on the machine, or there's a problem accessing the file,
then 'open' can fail, and you should take its failure behavior into account.

  -- 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.