title: Unix Shell Scripting and Java Jar Command
body: <p>I have a Unix shell script (bash) that sources some environment variables and then gives the user a few options.  Based on the user input I call some other Unix shell scripts that perform certain actions.  I'm having an issue with the start app server option below. When I  execute the appserver/run.sh script from main.sh I get a "Unable to access jarfile start.jar".  When I navigate directly to the run.sh script and run it from its directory, it works.  start.jar starts up a Jetty application server.  Any ideas on how to execute run.sh from main.sh?</p>
  
  <p><strong>permissions:</strong></p>
  
  <pre><code>-rw-r--r--  1 colgray eng  42364 Jan 10 15:40 start.jar
  </code></pre>
  
  <p><strong>main.sh:</strong></p>
  
  <pre><code>source ./setupenvironment.sh
  echo "Which Example would you like to run?"
  select yn in "one" "two" "start app server" "Quit" do
      case $yn in
          "one" ) ./examples/one/scripts/one.sh; break;;
          "two" ) ./examples/twp/scripts/two.sh; break;;
          **"start app server" ) ./examples/appserver/run.sh; break;;**
           Quit ) exit;;
      esac
  done
  </code></pre>
  
  <p><strong>/examples/appserver/run.sh:</strong></p>
  
  <pre><code>java -jar start.jar
  </code></pre>