Sorry I was not aware you don't want to block.

Reading the javadoc of Process
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html
makes me believe it is not defined.

best wishes,
Oti.

In any case,
On 7/2/07, astigmatik@gmail.com <astigmatik@gmail.com> wrote:
If I use os.system(), it 'blocks' my app until I close that external
app. Also, I don't know how to pass a parameter with os.system().

I just want to be able to double-click a URL in a JEditorPane and make
it open an external browser which is the preference of the user, and
that browser opens the clicked URL (not necessarily the browser that
is associated with opening URLs). The output of that is not important.
I also don't want to read/write from that process. I just want it to
open and leave it at that. And I was hoping to find a solution that'll
work for all OSes.

If Runtime.getRuntime().exe() is not the answer, then how do I do
this? I've looked at popen, and I think it's too complicated for
something so simple.


On 7/2/07, Oti <ohumbel@gmail.com> wrote:
> Hi,
>
> the caller of Runtime.exec() needs to consume the output of the started
> process.
> So in general I'd recommend to use os.system(), which IMHO handles this for
> you.
> Of course you still have to deal with the syntax details of the platforms.
>
> Best wishes,
> Oti.
>
>
> On 7/1/07, astigmatik@gmail.com <astigmatik@gmail.com > wrote:
> >
> > It was just an example. I'll get the value of 'browser' from users'
> preference.
> >
> > On 7/1/07, Frank Wierzbicki < fwierzbicki@gmail.com> wrote:
> > > On 6/30/07, astigmatik@gmail.com < astigmatik@gmail.com> wrote:
> > > > I ended up with a Javanese solution:
> > > >
> > > > browser = r'c:\program files\mozilla firefox\firefox.exe'
> > > > from java.lang import Runtime
> > > > Runtime.getRuntime().exec((browser, url))
> > > >
> > > > Question is, would this work on non-Windows platforms?
> > > It would work in principle, but you would need to use a platform
> > > specific path and executable name (for example, on linux it would look
> > > something like:
> > >
> > > browser = r'/usr/lib/firefox'
> > > from java.lang import Runtime
> > > Runtime.getRuntime().exec((browser, url))
> > >
> > > and on OS X you could probably achieve a similar effect like so:
> > >
> > > browser = r'/usr/bin/open'
> > > from java.lang import Runtime
> > > Runtime.getRuntime().exec((browser, url))
> > >
> > > although in the OS X case this would open whatever OS X would think of
> > > as the appropriate app for the particular resource pointed to with
> > > url.
> > >
> > > -Frank
> > >
> >
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Jython-users mailing list
> > Jython-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jython-users
> >
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users