title: Synology Scheduler .sh java command not found
body: <p>I have a bash script thats only task is to execute a jar file.</p>
  
  <p><strong>sms.sh</strong></p>
  
  <pre><code>java -jar /volume1/homes/jar/smssender.jar
  </code></pre>
  
  <p>Using my Synology NAS I set up a task.</p>
  
  <p><a href="https://i.stack.imgur.com/5uEJC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5uEJC.png" alt="Task Setup run by root"></a></p>
  
  <p>Adding the command to execute bash script. Adding log output.</p>
  
  <p><a href="https://i.stack.imgur.com/cR5dP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cR5dP.png" alt="enter image description here"></a></p>
  
  <p>Executing my new Task.</p>
  
  <p><a href="https://i.stack.imgur.com/2eWx6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2eWx6.png" alt="enter image description here"></a></p>
  
  <p><strong>Checking the log to see the following error:</strong></p>
  
  <blockquote>
    <p>/volume1/homes/jar/sms.sh: line 1: java: command not found</p>
  </blockquote>
  
  <p>Checking Java version/installation:</p>
  
  <p><a href="https://i.stack.imgur.com/TMoKr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TMoKr.png" alt="enter image description here"></a></p>
  
  <p>Checking execution of sh script manually (working):</p>
  
  <p><a href="https://i.stack.imgur.com/k4oOH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/k4oOH.png" alt="enter image description here"></a></p>
  
  <p>Anyone with this same strange case? Any workarounds/ideas? </p>
  
  <p>I tried</p>
  
  <ul>
  <li>Rebooting my NAS</li>
  <li>Uninstall / install Java8 package</li>
  </ul>
  
  <p>but none worked.</p>