I've run in several problemens using /usr/bin/open from my java
application.
I have 2 general cases:
1: if external application is not defined:
Runtime.getRuntime().exec(new String[] { "/usr/bin/open", "my file
name here" });
=> works
2: if external application is defined:
Runtime.getRuntime().exec(new String[] { "/usr/bin/open", "-a"
"'path_to_external_applicaiton_which_is_100%_executable_and_works",
"'my_file_here'" });
=> sometimes ok, but mostly "uhm, wtf?"..
In case 2 I have these problems:
1: external applicatin is not in the $PATH and contains a
backslash{es}
2: external application is in the "/Applications/" and have spaces
in the name
When using the same call from terminal, I have this error message:
$ /usr/bin/open -a '/User/me/tmp/blah\_blah.sh' 'file:/var/tmp/
image.jpg'
LSOpenFromURLSpec() failed with error -1081 for the file file:/var/
tmp/image.jpg.
I'm running OS X 10.5.4 and java 1.5.0_13-b05-237
Any suggestions?
The "open -a" variant should take either full path or the "name" of
the application, but the most reliable way to launch the app is with
the "open -b" variant which takes the bundle identifier of the target
application.
If you can provide a reproducible test case with the
Runtime.getRuntime().exec(String[]) call that should work with one of
the built-in applications, please file a bug at http://bugreporter.apple.com
.
Thanks,
Mike Swingler
Java Runtime Engineer
Apple Inc.
_______________________________________________
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