echois not a real team in the sense that it has a binary that you can run. This is a built-in shell feature.
You can try to run a type shell cmd.exeon Windows or shLinux / Mac / Unix, and then pass the command to run as a string. As with 'bash', you can do this
, Runtime
, exec, String[].
, .
public class RunTest {
public static void main(String[] args) throws Exception {
String [] commands = { "bash", "-c", "echo hello > hello.txt" };
Runtime.getRuntime().exec(commands);
}
}
, API Java, Runtime.