|
|
Hi,
I am trying to execute an unix schell script from Java class using Runtime.execute(). But i am getting exitValue 139 while doing this.
Please find the code snippet:
try{
String scriptName = "test.ksh";
String argParameter = "satish"; // parameter passed to ksh file.
String scriptToBePassed = "/usr/bin/ksh "+scriptName+" "+argParameter;
Process proc = Runtime.getRuntime().exec(scriptToBePassed);
int exitValue = proc.waitFor();
s.o.p("Exit Value is : "+exitValue);
}
catch(Exception e)
{
e.printStackTrace();
}While running the above code , i am getting 139 exit Value.
and also note that when i am running the script manually it went successful.
Above java code will generates command:
/usr/bin/ksh test.ksh satish.
The command is used to run manually.