Tuesday, April 29, 2008

How to launch a Unix script with Java

You can use folowing code snippet to launch a Unix script with Java.

String[] cmd = {"/bin/sh", "-c", "ls > hello"};
Runtime.getRuntime().exec(cmd);

For more details: Java Tips

No comments: