title: How can I run .sh file on MAC from other directory
body: <p>I'm a new for Mac developing.</p>
  
  <p>I try to create project.sh file and run it via Terminal</p>
  
  <p>See <a href="https://dl.dropboxusercontent.com/u/7278978/Work/mac.zip" rel="nofollow">mac.zip</a> for more details.</p>
  
  <p>The main class (com.myclass.MyClass) is in "main.jar" that requires lib1.jar, lib2.jar, and sublib1.jar</p>
  
  <p>The "CLASSPATH" property in "project.sh" is created via script, it cannot be changed in project.sh</p>
  
  <p>The value is always in relative path format such as "../../lib/lib1.jar"</p>
  
  <p>When I try to run it from "mac/project" directory that contains main.jar and project.sh via Mac Terminal</p>
  
  <p>It work fine as following</p>
  
  <pre><code>Gui-iMac:project gui$ ./project.sh
  AClass
  BClass
  CClass
  </code></pre>
  
  <p>However, when I try to run project.sh from other directory, it failed.</p>
  
  <p>For example: run from desktop directory:</p>
  
  <pre><code>Gui-iMac:desktop gui$ "/Users/gui/Desktop/GUI/Mac/project/project.sh"
  Error: Could not find or load main class com.myclass.MyClass
  </code></pre>
  
  <p>How can I run project.sh from other directory?</p>
  
  <p>Please help me to solve this problem.</p>
  
  <p>Thanks in advance.</p>
  
  <p>earist</p>