xrandr hangs and can't start X app

ikevin8me

Active Member

Reaction score: 12
Messages: 179

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!
 
OP
I

ikevin8me

Active Member

Reaction score: 12
Messages: 179

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?
 
OP
I

ikevin8me

Active Member

Reaction score: 12
Messages: 179

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….
 
OP
I

ikevin8me

Active Member

Reaction score: 12
Messages: 179

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

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,592
Messages: 37,913

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

ikevin8me

Active Member

Reaction score: 12
Messages: 179

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

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,592
Messages: 37,913

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.
 
OP
I

ikevin8me

Active Member

Reaction score: 12
Messages: 179

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

mer

Well-Known Member

Reaction score: 185
Messages: 323

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

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,592
Messages: 37,913

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)).
 
Top