🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2293

Re: Exectuting external app

#2293
From: John McGrath TeamB
Date: Fri, 23 Mar 2001 07:43
25 lines
1811 bytes
On Thu, 22 Mar 2001 13:46:21 -0700, Calvin R. Smith wrote:

> How can I execute an external program (java.exe) and have
> it open it's own window and display the print statements
> in it's own window?

The Java Runtime exec() methods pipe the output from the subprocess 
back to the JVM.  You can get input streams to read the output from
the Process object returned by exec(), using the getErrorStream() and 
getInputStream() methods.

This is actually something you should do whenever you use the Runtime 
exec method, if there is any possibility that the process will produce 
any output.  If you do not and the buffers for one of the pipes fills 
up, your subprocess will hang.  And to read the output from both of the 
streams simultaneously, you will need to spawn threads.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.1524c8bd4b2eac3e98a095@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews!209.92.40.60
References: <3aba6504_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,dc52a4c87b02d0a0
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-03-23 03:31:13 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: Exectuting external app
Date: Fri, 23 Mar 2001 02:43:51 -0500
Message-ID: <MPG.1524c8bd4b2eac3e98a095@forums.borland.com>
References: <3aba6504_2@dnews>
X-Newsreader: MicroPlanet Gravity v2.30
NNTP-Posting-Host: 209.92.40.60
X-Trace: 22 Mar 2001 23:39:26 -0800, 209.92.40.60
Lines: 25
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews!209.92.40.60