Executing shell commands from java

Discussion in 'Mac Programming' started by ashokformac, Apr 3, 2007.

  1. macrumors member

    Joined:
    Mar 26, 2007
    #1
    how to execute a shell command from java on a mac machine..


    thanks in advance
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The same way as any other machine. Via Runtime exec methods. The return a Process object which gives you access to stdin, stdout and stderr of the process. Wrap these in BufferedReader/Writer objects and you are good to go.
     

Share This Page