Executing terminal commands in my Java application.

Is it possible to execute terminal commands through a java program? I.E. make a program that runs a line of code in ther terminal to change system prefernces? or even simpl things like changeing dircetory and making folders,

I need to do this for mac (unix), but any info for windows(ms-dos) would be appriciated aswell.

[333 byte] By [coryw68122a] at [2007-10-3 4:03:32]
# 1
Runtime.getRuntime().exec()But for making folders & such stuff you don't need to execute Shell commands. You should rather use the API provided by java.io.File (mkdir() for example).
JoachimSauera at 2007-7-14 22:02:32 > top of Java-index,Java Essentials,Java Programming...
# 2
Just as a note: cross-posted in the Swing forum.
masijade.a at 2007-7-14 22:02:32 > top of Java-index,Java Essentials,Java Programming...