Can I use Runtime to achieve the same? If so what are the pros/cons I have to invoke a shell script from java.
Thanks in advance.
You can use Runtime.exec() to execute a shell script from Java. Of course this will make it less cross-platform and harder to maintain. If you want to wait for the shell script to finish you need to use the Process object returned by exec() and call waitFor(). You can also get the stdin/out/err which is very useful. You might also want to explicitly call the correct shell e.g. exec("sh script.sh").
If you need more control about creation of the process, ProcessBuilder is a more powerful alternative to Runtime.exec(...).