Runtime.getRuntime().exec("./test.sh");

by Vinoth 2009-02-21 17:54:58

1.Create a Sh file and specify the functionality
2.Run the bellow java code

public class Sh
{
public static void main(String[] args)
{
try
{
Process proc = Runtime.getRuntime().exec("./test.sh");
System.out.println("Print Test Line.");
}
catch (Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}

Tagged in:

6161
like
1
dislike
0
mail
flag

You must LOGIN to add comments