java - No X11 DISPLAY variable - what does it mean

java – No X11 DISPLAY variable – what does it mean?

java – No X11 DISPLAY variable – what does it mean?

If youre on the main display, then

export DISPLAY=:0.0

or if youre using csh or tcsh

setenv DISPLAY :0.0

before running your app.

Actually, Im surprised it isnt set automatically. Are you trying to start this application from a non-graphic terminal? If not, have you modified the default .profile, .login, .bashrc or .cshrc?

Note that setting the DISPLAY to :0.0 pre-supposes that youre sitting at the main display, as I said, or at least that the main display is logged on to your user id. If its not logged on, or its a different userid, this will fail.

If youre coming in from another machine, and youre at the main display of that machine and its running X, then you can use ssh -X hostname to connect to that host, and ssh will forward the X display back. ssh will also make sure that the DISPLAY environment variable is set correctly (providing it isnt being messed with in the various dot files I mentioned above). In a ssh -X session, the DISPLAY environment variable will have a value like localhost:11.0, which will point to the socket that ssh is tunnelling to your local box.

Are you running this from within an X11 environment? You can use a terminal window, but it has to be within X (either after a graphical login, or by running startx).

If youre already within a graphical environment, try export DISPLAY=:0 for bash like shells (bash, sh, etc) or setenv DISPLAY :0 for C shell based shells (csh, tcsh, etc)

If youve connected from another machine via SSH, you use the -X option to display the graphical interface on the machine youre sitting at (provided theres an X server running there (such as xming for windows, and your standard Linux X server).

java – No X11 DISPLAY variable – what does it mean?

you must enable X11 forwarding in you PuTTy

to do so open PuTTy, go to Connection => SSH => Tunnels and check mark the Enable X11 forwarding

Also sudo to server and export the below variable here IP is your local machines IP

export DISPLAY=10.75.75.75:0.0

enter

Related posts on java  :

Leave a Reply

Your email address will not be published.