How to make a B4J application autostart on Windows, Macintosh, Linux, Solaris, Ubuntu, Qubes, and any other O/S that can run Java Virtual Machine.
Every relevant solution is welcomed. Thanks
On a Raspberry Pi there are various ways to setup Autostart of a Jar file.
One way is by editing (using the nano editor), as User root, the file /etc/rc.local and add, before exit 0,
following code for the application rpiconsole.jar:
$cd /etc
$nano rc.local
B4J Server Application weathercubeone
cd /home/pi/b4j/webapps/weathercubeone
/usr/bin/java -jar weathercubeone.jar &
Or
B4J Non-UI Application TFWeatherToDomoticz
cd /home/pi/domoticz/scripts
/usr/bin/java -jar tfweathertodomoticz.jar &
Checks after Reboot
Login as Pi
To list all processes:
$ps -ef
To dedicated check for process weathercubeone
$ ps -ef | grep weathercubeone
Output Example:
root 2138 1 1 20:12 ? 00:00:07 /usr/bin/java -jar weathercubeone.jar
Kill Process
Select the PID and invoke using above PID
$kill 2138
Note:
If permission error, set root priviledge:
$sudo -i