title: getting permission denied after using chmod +x on Linux while executing Java program
body: <p>Here is my executable file:</p>
  
  <pre><code>  #!/bin/bash
    JAVA_HOME=/cad2/ece419s/java/jdk1.6.0/
    # arguments to GameServer
    # $1 = port # where GameServer is listening
  
    ${JAVA_HOME}bin/java GameServer $1    
  </code></pre>
  
  <p>I run the <code>chmod</code> command as:</p>
  
  <pre><code>  chmod +x server.sh
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>  ./ server.sh 8000
  </code></pre>
  
  <p>8000 is the port from local computer which my server is listening to.</p>
  
  <p>After <code>bash -x server.sh 8000</code>, I got <img src="https://i.stack.imgur.com/VQmrT.jpg" alt="this"></p>