1

I'm trying to run My Java Program

final GpioController gpio = GpioFactory.getInstance();
 mux_a = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_02, "MUX_A", PinState.LOW);
 mux_b = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03, "MUX_B", PinState.LOW);

I have done like

sudo java -jar Sample1.jar

but it throws an Exception as no protocol specified.

java.awt.AWTError: Can't connect to X11 window server using ':0' as DISPLAY variable.

I have tried:

unset DISPLAY;
export DISPLAY=:0;
export DISPLAY=:0.0'

but nothing works out.

But It works fine while calling it from the Putty in my windows system. Suggest me where I'm missing

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78
  • see http://unix.stackexchange.com/questions/281651/not-able-to-run-simple-java-swing-program-on-raspbian-on-raspberry-pi-2-headless – Wolfgang Fahl Feb 17 '17 at 16:55

0 Answers0