Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ashokformac

macrumors member
Original poster
Mar 26, 2007
34
0
how to execute a shell command from java on a mac machine..


thanks in advance
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.