>>> Has anyone had any luck RUNNING a program from Java? Example below (JDK
116) compiles OK, prints a nicely formed command OK buts generates *NO*
output.

thanks,

import java.io.*;
public class RunFile    {
      public static void main ( String args[] )
           throws Exception                       {
            try {
              Runtime rt = Runtime.getRuntime ();
//  Build a cmd-string :
              String RunCmd =
                " /usr/bin/grep -in main  *.java ";
              System.out.println ("RunCmd: " + RunCmd);
              Process procs = rt.exec (RunCmd);
              DataInputStream dis = new DataInputStream
                                   (procs.getInputStream() );
              String line;
              while (( line = dis.readLine () ) != null )
                System.out.println (line);

            } catch (IOException ioe) {
               System.out.println ("Runtime/Process error");
            }                   // end try
    }                   //  end main
}                       //  end class

--------------------------------------------

Bill Paladino


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to