I want to execute an exe file (say, a.out) in hp-ux 10.20 from the
java program.
1) The java code
Runtime.getRuntime().exec(". ./a.out");
is NOT WORKING
2) The java code
Runtime.getRuntime().exec("a.out");
is NOT WORKING
3) I wrote a script (say,
test)
#!/bin/sh
a.out
Then i called this script from the java program
Runtime.getRuntime().exec("test");
This is also NOT WORKING
4) I wrote a script (say, test)
a.out
Then i called this script from the java program
Runtime.getRuntime().exec(new
String[] {"/bin/sh", "test"});
This code is WORKING
Could someone please explain me why the codes (1, 2 and 3) are not working and why the code 4 is working...Thanks a lot...