I am trying to run a server (say a Apache Server or a tomcat servlet engine)on a remote machine using RMI for which I utilize the capabilities provided by the java.lang.Runtime class.When I execute the command I would like to show the results of the process to the user and at the same time I would like to specify whether the server has started successfully.For this I preferred to get the input stream of the process buffer it and read it.The problem now I am facing is ,when I try to read the stream I am unable to come out of the loop,because the input stream of the process has not ended.
I wrote a RemoteRuntime server geared at just that. http://crazybob.org/runtime.zip. Edit the "runtime.policy" file to tighten/ease the security restrictions.
As a side note, the call to the RemoteRuntime does not return until the process has completed. If you run apache or something, make sure it's set up to return the results and fork another process so that the first can return.