title: Java utility unable to find and read its properties file
body: <p>I have to execute a java utility  (UTL.jar) through a shell script (mainUTL.sh). It utilizes a properties file (SetupUTL.properties). </p>
  
  <p>The location of the files is as following -
      /a/b/mainUTL.sh
      /a/b/UTL.jar
      /a/b/SetupUTL.properties</p>
  
  <p>I have setup my CLASSPATH as following in the mainUTL.sh - </p>
  
  <pre><code>export CLASSPATH=$CLASSPATH:/a/b/SetupUTL.properties:/a/b/UTL.jar
  </code></pre>
  
  <p>I am executing the script from command prompt (Login shell is csh) as following - </p>
  
  <pre><code>sh mainUTL.sh &lt;$ARG1&gt; &amp;
  </code></pre>
  
  <p>and the script mainUTL.sh has the following java execution command - </p>
  
  <pre><code>nohup $JAVA_HOME/bin/java -d64 UTL.jar &lt;$ARG1&gt;
  </code></pre>
  
  <p>Now when I am executing the shell script from location /a/b/ as  following</p>
  
  <pre><code>/a/b$: sh mainUTL.sh &lt;$ARG1&gt; &amp;
  </code></pre>
  
  <p>The utility is executing fine.
  But when I am executing the shell script from any other location say /a/ as  following</p>
  
  <pre><code>/a$: sh mainUTL.sh &lt;$ARG1&gt; &amp;
  </code></pre>
  
  <p>The utility is unable to find its properties file. The utility has following piece of code -</p>
  
  <pre><code>  private boolean initPropertiesAndLog()
    {
      String str1 = null;
      String str2 = null;
  
      InputStream localInputStream = ClassLoader.getSystemResourceAsStream("SetupUTL.properties");
      if (localInputStream == null) {
        System.out.println("Unable to read SetupUTL.properties.properties file.");
        return false;
      }
  </code></pre>
  
  <p>I am not at all aware of Java codes, so please tell me what wrong I am doing as to not able to execute the utility fine.</p>