tags:

views:

149

answers:

3

How to start external application from Scala?

+1  A: 

Since Scala runs on the JVM, you can do this the same way as you would in Java, by using Runtime.exec(...) (look that up in the Java API documentation).

You can also use java.lang.ProcessBuilder for more control.

Jesper
A: 

There is a very good library (DSL) written for this called simple-build-tool

cat(file)  #| "grep -i scala" !
oxbow_lakes
A: 

Use the Process library, which was a part of SBT but is now being separated from it. You can find it here in the Scala Tools repository.

With that, it can be as simple as:

import Process._
"find project -name *.jar" ! log
Daniel