Belief me i went through several websites and tested many proposals to run my JAVA based GUI application on Raspberry Pi start-up. Finally the following worked out
First check inside the .config folder if it contains autostart folder or not , if not then create a folder named as autostart.
Create a myApp.desktop file inside the autostart folder.The myApp.desktop file should contain the following
Exec=sudo /usr/bin/java -classpath /home/pi/:/home/pi/Desktop/Display_lib/*.jar -jar /home/pi/Desktop/Display.jar
Thats all reboot your pi and your application should run now….. You can also do that by following method.. edit rc.local file and put the code just befor the exit 0.
#sudo /usr/bin/java -classpath /home/pi/:/home/pi/Desktop/Display_lib/*.jar -jar /home/pi/Deskt/Display.jar
Another thing is to run the GUI app continuously you also need to disable the default screen blackout. To do that just edit the rc.local file and put the following codes.
setterm -blank 0 -powerdown 0 -powersave off
Or edit the ~/.xinitrc file and put the following codes..
xset s off
xset s noblank
setterm – terminal blanking
kbd configuration – terminal blanking
lxde configuration – Xsession blanking
lightdm configuration – Xsession blanking
Latest posts by Bikash Panda (see all)
- Firmata protocol with Raspberry Pi and Arduino - September 13, 2017
- IOT:Power outlet controlled from internet using WeMOS - August 9, 2017
- OSMC on Raspberry PI with Setup and Control using Android App - July 7, 2017