Compile a full linux directory using Runtime ?

Hi!!

I'm trying to compile a full linux directory. I've tried:

String cmd ="javac dir/*.java" -d"+mydir+" -classpath"+myclasspath;

Runtime r = Runtime.getRuntime();

r.exec(cmd);

or

Runtime r = Runtime.getRuntime();

r.exec("/bin/sh -c \""+cmd+"\"");

or

Runtime r = Runtime.getRuntime();

r.exec("/bin/bash -c \""+cmd+"\"");

or

Process p = Runtime.getRuntime().exec(cmd);

or

Process p = Runtime.getRuntime().exec("/bin/sh -c \""+cmd+"\"");

or

Process p = Runtime.getRuntime().exec("/bin/bash -c \""+cmd+"\"");

any one of them runs. What am i doing bad ? Where is the failure ?

On Windows XP it runs ok with:

Process r = Runtime.getRuntime().exec("cmd /c"+cmd);

I need help, please.

Thanks and excuse my english

David.

[1158 byte] By [davidpaa] at [2007-10-3 4:17:49]
# 1
{ "sh" , "-c", "javac -d whatever -classpath whatsoever dir/*.java" }
BIJ001a at 2007-7-14 22:19:27 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks a lot for your help. Now it runs.
davidpaa at 2007-7-14 22:19:27 > top of Java-index,Java Essentials,Java Programming...