I admit I'm a complete noob at this, but I've done my homework on this site and I still can't get what I want to happen. I'm trying to get a .jar file to run at startup on a rasbpian installation. Let's call it startup.jar, it's in /home/pi/ so if I enter:
/usr/bin/java -jar /home/pi/startup.jar
at the command line, it works no matter which directory I'm in when I enter it. So from /home/pi I enter:
cat > startupscript << EOF
/usr/bin/java -jar /home/pi/startup.jar
EOF
Then I enter:
chmod u+x startupscript
Now if I go to /home/pi and type sh startupscript
it does exactly what I want. So then I type
sudo nano /etc/rc.local
and before the exit line I add:
sh /home/pi/startupscript &
But startup.jar still doesn't start at startup.
I've also tried copying startupscript into /etc/init.d/
and entering "sudo update-rc.d startupscript default[s, tried it with/without the s here]" but no dice.
Again, I realize this is a noob question, but what am I missing? I'm sure it's something simple.