You have to know where you put your jar file.
You have to test the command in a terminal first to know it’s working before pasting into /etc/rc.local file
For example, you place your jar and Data files in a directory /home/pi/Blynk, you use the following command in your terminal as well as /etc/rc.local
You posted something strange, as the machine complains about no jarfile /home/pi/server-0.41.11-java8.jar, while your command specifying another jarfile /home/pi/Blynk/server-0.41.11.jar
If you have use the correct command specifying correct jarfile location, but still get error:
Error: Unable to access jarfile /home/pi/Blynk/server-0.41.11-java8.jar
then the problem might be you set wrong file permission when install the Blynk Server jarfile.
If this is the case, use sudo chown and/or sudo chmod commands to do the change.
I’m sorry, unwittingly I pasted bad command, but I used correct command and I give chmod 777 on jar file and nothing.To run manually I always have to go to sudo su
So, the problem is that you used root account to install Blynk, the result is all files have owner:group = root:root, and you won’t have the right to access and execute while using pi or another non-root account. That’s why it only works when you’re using sudo su to be root.
The fix now is to change the files’ ownership back to pi or whatever account you’re using. Let’s say pi.
I assume that you have all Blynk server files installed in /home/pi/Blynk. You have to use the following command while you’re using pi account:
# comment, don't run. Go to pi home directory
$cd /home/pi
# comment, don't run. Get ownership:group back to pi:pi
$sudo chown -R pi:pi /home/pi/Blynk
# comment, don't run. Change mode to -rwxr----- for all files. Not perfect but OK for now for you to run
$chmod -R 740 /home/pi/Blynk
Also please read the note about not using root account unless absolutely necessary in:
One note is that you’d better not use root account in everyday job. One small mistake can destroy your system. Use pi or whatever account you create but root. Whenever you need root privilege, use sudo. Also change the default root and pi password.
pi@raspberrypi-02:~ $ sudo passwd root
pi@raspberrypi-02:~ $ passwd
sudo apt-get install oracle-java8-jdk(Error:This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘oracle-java8-jdk’ has no installation candidate)
This command not working for me. I installed zulu java form this site: https://community.openhab.org/t/howto-install-zulu-embedded-java-on-raspberry-pi-3/22589/44
that’s why I needed sudo su
I was found my problem. I had changed sudo su (https://community.openhab.org/t/howto-install-zulu-embedded-java-on-raspberry-pi-3/22589/44) because command sudo apt-get install oracle-java8-jdk not working Do you know how this repair?
You can use openjdk-8 instead of oracle-java8-jdk by using this command
$sudo apt install openjdk-8-jdk
It’s a hassle to use oracle-java now as they change the model. You have to login to an account, download the package to install. Openjdk java is as good as oracle-java
No, you’re very good. You’ve have finished many complicated steps in order to successfully install and run your own Blynk Local Server. Just a very small mistake means nothing.
I just like to add a note about this crontab -e problem which seems to affect many people running Local Blynk Server. The crontab is started very early in the rebooting process, when the network might not be ready yet. All other commands in crontab running periodically (such as every 5 minutes) will work OK, but the very first one if it relies on Network operation. Certainly all the commands requiring Network operation will fail if no precaution is taken.