title: Autorun jar on Raspberry Pi (Raspbian) after boot up, rc.local not working?
body: <p>I want to auto run a .jar file after my Raspberry Pi boots up.</p>
  
  <p>Normally I execute to .jar file with the following command (works great):</p>
  
  <pre><code>sudo java -classpath .:phidget21.jar -jar TestSensor.jar
  </code></pre>
  
  <p>(I can't simply use java -jar TestSensor.jar since the phidget21.jar needs to be appended to make the TestSensor.jar work properly)</p>
  
  <p>Now, I want to execute the above command at the boot up of my raspberry pi.</p>
  
  <p>As suggested in many places I tried to solve it with the rc.local file.</p>
  
  <p>I added the following two lines:</p>
  
  <pre><code>cd /home/pi
  sudo java -classpath .:phidget21.jar -jar TestSensor.jar
  </code></pre>
  
  <p>Unfortunately that doesn't work.</p>
  
  <p>Even</p>
  
  <pre><code>cd /home/pi
  sudo java -jar TestSensor.jar
  </code></pre>
  
  <p>Doesn't start the TestSensor.jar on a boot up.</p>
  
  <p>What am I doing wrong? Any idea how to fix it?</p>
  
  <p>Thanks</p>