Cannot execute shell script in Java [duplicate]

This question already has an answer here:

I want to execute a shell script(in linux environment) from a java program and my code snippet is like below :

try {
            ProcessBuilder pb=new ProcessBuilder("/bin/bash","/home/user/");
            Process p;
            p = pb.start();
            System.out.println("Executed Shell Script");

        } catch (IOException e) {

But when I execute this java program the program runs and prints the executed statement but it is not executing the shell script and not throwing any errors .I am not sure why is this happening. Any help is appreciated.

Cannot execute shell script in Java [duplicate]