# xrandr hangs and can't start X app



## ikevin8me (Jun 7, 2021)

I'm trying to run a Java GUI application and I'm getting: 


> awt.awterror:can't connect to x11 window server using ':0.0' as the value of the DISPLAY variable



I've already set "setenv DISPLAY :0.0".

The machine has xorg and kde5 installed and running.

How can I resolve this problem? Please help!


----------



## ikevin8me (Jun 7, 2021)

Is there a sysctl to allow this or something?


----------



## ikevin8me (Jun 7, 2021)

I tried "setenv DISPLAY 127.0.0.1:0.0", and then started the Java jar app. There was no error but nothing happened, which seems like the app opened, but probably opened on the wrong display output?


----------



## ikevin8me (Jun 7, 2021)

I have also tried some other *non* *Java* apps that uses the display and same *thing* happened. That is, the program seem to launch and running but nothing happens on the screen.

If I remove it by “setenv DISPLAY” (with nothing following), it reports “Can’t open display”.

please help….


----------



## ikevin8me (Jun 7, 2021)

Alright, from within Konsole in KDE, I set “setenv DISPLAY localhost:0.0”. Upon entering “xrandr”, the command just hang - no error message and I had to press Ctrl-C to end it. Please help


----------



## SirDice (Jun 7, 2021)

Stop messing around with the DISPLAY variable. You do NOT need to set it.


----------



## ikevin8me (Jun 7, 2021)

If I don't set it, it will say "Can't open display" - for xrandr and all the apps (Java/non-Java).


----------



## SirDice (Jun 7, 2021)

No, it won't. Just don't try to start these things as root and use the same account you used to login on KDE.


----------



## ikevin8me (Jun 7, 2021)

Thanks! That worked. (I was starting as root). I realized I need to start as a user which is part of "video" group.


----------



## mer (Jun 7, 2021)

ikevin8me said:


> Thanks! That worked. (I was starting as root). I realized I need to start as a user which is part of "video" group.


The message that gets displayed when drm-kmod gets installed says:

Please ensure that all users requiring graphics are members of the
"video" group.

Of course it is easy to miss this especially during an install.


----------



## SirDice (Jun 7, 2021)

Root is not allowed to open a window on a user's X session either. That's where the DISPLAY message comes from (environment is also cleaned when you su(1) or sudo(8)).


----------

