No X11 DISPLAY variable was set, but this program performed an operation which requires it
If X server is running on the target host and you want the program to display there, you usually perform 'export DISPLAY=:0' where :0 would mean the first X server running. If you are running several X servers (for example Xvnc) on the target host, :0 may become :1 or another number, depending on X server configuration.
If you have X server running locally (the machine you are connecting from) you could use 'ssh -X ...' or 'ssh -Y' to log in to the host and forward your display to the program run remotely. See other answers on redirecting X server over SSH.
Edit: Please check the answer in the linked article.
TL;DR:
- Ensure xauth is installed on target
- In /etc/sshd_config set
X11Forwarding yes
- Run ssh with -vv to check what is the problem, if any
Related videos on Youtube
mmenon
Updated on September 18, 2022Comments
-
mmenon over 1 year
I am trying to install a program on RedHAt7 using ssh / connecting to server. I received the output the following
Exception in thread "main" java.lang.ExceptionInInitializerError at org.greenstone.gatherer.Gatherer.init(Gatherer.java:284) at org.greenstone.gatherer.Gatherer.<init>(Gatherer.java:234) at org.greenstone.gatherer.GathererProg.main(GathererProg.java:78) Caused by: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at sun.awt.HeadlessToolkit.getScreenSize(Unknown Source) at org.greenstone.gatherer.Configuration.<clinit>(Configuration.java:111) ... 3 more
How to fix X11 Display?
-
mmenon almost 7 yearsubuntu@ubuntu-ThinkCentre-M58p ~ $ ssh -Y root@server ip address... root server ip...'s password: X11 forwarding request failed on channel 0. why happened like this
-
mmenon almost 7 yearsubuntu@ubuntu-ThinkCentre-M58p ~ $ ssh -X root@server ip address... root server ip...'s password: X11 forwarding request failed on channel 0.
-
mmenon almost 7 yearsboth tried X and Y
-
mmenon almost 7 yearsssh -X -1 not works