views:

193

answers:

1

I am using Java to automate a build. I would like to run an 'scons' command in the current directory in which the build is being performed. How can I do this with Java? I have tried

Runtime.getRuntime().exec(CurrentDir + commandString)

This didn't work. Any ideas would be greatly appreciated.

+4  A: 

You must use the Java 5 API ProcessBuilder to change the current directory for a new process.

Aaron Digulla