problem while running shell script using java-Collection of common programming errors

Try this, it will definitely works.

Shell Script test.sh code

   #!/bin/sh
   echo "good"

Java Code to execute shell script test.sh

          try {
                Runtime rt = Runtime.getRuntime();
                Process pr = rt.exec(new String[]{"/bin/sh", "/tmp/padm/.test.sh"});

                BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                String line = "";
                while ((line = input.readLine()) != null) {
                    System.out.println(line);
                }
            } catch (Exception e) {
                System.out.println(e.toString());
                e.printStackTrace();
            }