David Rocks <email@hidden> wrote:
>The trace shows this as the string passed to runtime.exec:
>> Launching /usr/bin/osascript -e 'tell application "Safari" to open
>>loacation "
>>file:/Users/rocks/Desktop/TestC/eclipse/plugins/org.eclipse.webrowser_3.0.1/home
>>/home.html "'
>
>But from yours and others suggestions, I need to spend some time looking
>at the code more closely. The string is built up in parts and may not
>look exactly the same to the call. The trace output is just a print
>statement, more or less. Since it works ok from the shell it is more
>likely a problem of how it is passed and may indeed be waiting on stdin
>when it shouldn't.
If the trace is really no more than a single println(), then it looks like
part of the problem is that exec(String) is being used. This is almost
always wrong, since exec(String) will not parse quotes (see its API docs).
If it's really using exec(String), you need to fix it to use
exec(String[]), and structure the command-array accordingly. If it's reall
using exec(String[]), I suggest modifying the trace to print each String as
an identifiably distinct item.
If the trace you posted was pasted in from an actual trace output, then
part of the problem is a typo:
you misspelled 'location' as 'loacation'.
There's no way that's going to work as given, and you'll have an osascript
error on stderr that complains. Assuming that it hasn't deadlocked because
of the stderr-pipe filling up.
Also, since I consistently see "file://" in the browsers themselves, I
suggest using that form rather than "file:" alone.
>The code was written to support a simple call with a
>parameter and developed on a windows platform. IBM added support for
>linux later when they donated it to the eclipse project and I'm trying
>to make it work on OS X. I'm not sure if there aren't problems on linux
>as well. I thought this would just be a problem of creating the right
>entries in a configuration file. But I admit it has been more fun than
>that.
It may well be just a question of the right entires in a config file.
What's the simple call's API, the parameter's value, and the config-file's
contents right now?
-- 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