I am reading this answer, and I edited /etc/xdg/lxsession/LXDE-pi/autostart, by appending the following line:
@sudo java -jar /home/pi/Documents/devel/MyProject/MyProject.jar But nothing happens when I reboot the Pi, the program does not get started. I will also want to have a terminal window if possible.