8

With my Raspberry Pi, I managed to login pi user automatically, then start tomcat automatically and then start X server as well.

For those interested, auto login:

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

instead of

1:2345:respawn:/sbin/getty 115200 tty1

in /etc/inittab

and

sh /home/pi/apache-tomcat-7.0.47/bin/startup.sh
su -l pi -c startx
exit 0

in /etc/rc.local

Now, I'd like to launch a java program (jar file) that I made, automatically after server X has started. How could I do that?

Thank you

UPDATE: On my Rapsberry, as LXDE is used, http://wiki.lxde.org/en/Autostart solved my problem.

Romain Pellerin
  • 2,470
  • 3
  • 27
  • 36

1 Answers1

5

startx uses the ~HOME/.xinitrc file to load programs at the startup of X where ~HOME is the home directory of the user running X [ in this case pi]

see http://www.x.org/archive/X11R6.8.1/doc/startx.1.html for an example of .xinitrc

WhyteWolf
  • 456
  • 2
  • 9
  • Thanks, it's working.. partially. As the .xinitrc file was not existing, I created it using `echo "jar -jar myfile.jar" > .xinitrc` After a reboot, the jar file is correctly launched but all the rest of the screen remains black (cannot see wallpaper, bottom bar, icons, etc). I think the file is overriding something. How to fix it ? Thanks – Romain Pellerin Nov 11 '13 at 22:54