I have a Java GUI app that runs fine on my windows PC and on a Raspi running Raspian when the Raspi has a monitor connected. I want to run the java app on the Raspi without a monitor attached. I'm currently interacting with the Raspi using TightVNC. When I run the java app on the pi without a monitor, I get the following error:
Can't connect to X11 window server using ':2.0' as the value of the DISPLAY variable.'
(I start the VNCServer on the Raspi with a file which includes the line:
su - $USER -c "/user/bin/vncserver :2 )
and what I see at the top left of my VNC client window on my PC is:
pi's X desktop(raspberrypi:2)
Can anyone help me get the java GUI working on the pi via VNC?