title: Java calling bash script : Permission Denied Error
body: <p>I am trying to call a bash script from a java class .</p>
  
  <p>This is my java program </p>
  
  <pre><code>import java.io.File;
  
  public class RunBuild {
      public static void main(String[] args) {
          File wd = new File("/home/sai/Jan5WS/ATCore/bin/");
          System.out.println("Working Directory: " + wd);
          Process proc = null;
          try {
              proc = Runtime.getRuntime().exec(" . Ram.sh", null, wd);
              System.out.println(proc.getInputStream());
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>I have got all the permissions for that script , please see below
      sai@sai-Aspire-4720Z:~/Jan5WS/ATCore/bin$ chmod 7777 Ram.sh</p>
  
  <pre><code>-rwxrwxrwx 1 sai sai    77 Feb  3 20:53 Ram.sh~
  -rwxrwxrwx 1 sai sai    79 Feb  3 20:53 Ram.sh
  sai@sai-Aspire-4720Z:~/Jan5WS/ATCore/bin$
  </code></pre>
  
  <p>Its throwing this exception below </p>
  
  <pre><code>Working Directory: /home/sai/Jan5WS/ATCore/bin
  java.io.IOException: Cannot run program "." (in directory
  "/home/sai/Jan5WS/ATCore/bin"): error=13, Permission denied
      at java.lang.ProcessBuilder.start(Unknown Source)
      at java.lang.Runtime.exec(Unknown Source)
      at java.lang.Runtime.exec(Unknown Source)
      at RunBuild.main(RunBuild.java:12)
  Caused by: java.io.IOException: error=13, Permission denied
      at java.lang.UNIXProcess.forkAndExec(Native Method)
      at java.lang.UNIXProcess.&lt;init&gt;(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 4 more
  </code></pre>
  
  <p>I am using Ubuntu 
  Please let me know what could be the problem ??</p>