1

I am new to linux and raspberry Pis. I wrote a Java Program, whith a Gui. I am remoting my Raspberry Pi over ssh in the same Network via Putty I created an executable jar File of my Java Program and tried to run it over the raspberry but the only Thing I get is the Error below. Other Java Programs without Guis like HelloWorld work fine. Also the "xclock"Command is no Problem and Displays the Window on my Screen.

I am running an XMing Server:0.0 and X11 Forwarding is activated on Putty and in the Raspberry Settings

I tried to change the Display to "localhost:0.0" with "export Display=localhost:0.0" but the Error remains the same.

Thank you in advance and sorry for my bad English, it is not my native Language

PuTTY X11 proxy: Unsupported authorisation protocol
    Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
    at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
    at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at java.awt.Toolkit$2.run(Toolkit.java:860)
    at java.awt.Toolkit$2.run(Toolkit.java:855)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
    at java.awt.EventQueue.invokeLater(EventQueue.java:1264)
    at learningprograms.ColorCodes.main(ColorCodes.java:27)
    ... 5 more
groetzda
  • 31
  • 1
  • Possible duplicate of [Java Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable](https://stackoverflow.com/questions/10165761/java-cant-connect-to-x11-window-server-using-localhost10-0-as-the-value-of-t) – yunandtidus Jun 08 '18 at 08:45
  • I already tried the Solutions from the other Question but nothing worked for me – groetzda Jun 08 '18 at 09:16
  • I solved the Errors now by changing the Xauthority file But now the Gui appears on the Screen of my Raspberry Pi. My aim is to unplug the Monitor from the Raspberry and show the Program on my Screen, but if i unplug it the Gui just disappears – groetzda Jun 08 '18 at 09:24
  • If I use export DISPLAY=:0.0 the Jar File and xclock are displaying on my Raspberry Screen, but if I try export DISPLAY=:10.0 the Jar Files gives me again the same Error, that is shown above... xclock for example works fine and opens on my monitor, where I want it – groetzda Jun 08 '18 at 11:23

0 Answers0