title: Running a shell script from java code
body: <p>I am almost dead trying to sort this out.. Can someone help... please?</p>
  
  <p>Below is the code:</p>
  
  <pre><code>import java.io.*;
  import java.lang.Runtime;
  import java.util.*;
  
  public class WORKBRO {  
  
      public static void main(String args[])
      {
          try
          {    
              String target = new String("/home/dhirendra.panwar/Desktop/test.sh");
              Runtime rt = Runtime.getRuntime();
              Process proc = rt.exec(target);
  
          } catch (Throwable t)
          {
              t.printStackTrace();
          }
      }
  }
  </code></pre>