Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have connected Linux server (centos 64bit)using VNC viewer. Then I have tried to run java swing application using this command (java -jar app.jar).

I am getting this error "Can't connect to X11 window server using ': 2.0' as the value of the DISPLAY variable"

share|improve this question

migrated from Mar 28 '13 at 15:58

This question came from our site for professional and enthusiast programmers.

could you run other x application like xclock/xcalc? What this says is display server at 2.0 is not allowing client to connect to it. – Jayan Mar 28 '13 at 12:49
  1. ensure there is display at :2.0 (looks like you had white space?)
  2. ensure that the display allows clients to connect from some where. (xhost + ...)

( xhost + will allow every client to connect. You can restrict to your ip or some thing like that.)

share|improve this answer
tnx for your response. I am new in linux. could you please tell me the step to check display and xhost – Selvam R Mar 28 '13 at 13:30
using root user. I am able to open the swing ui. but not from other user. any idea how to set the same ui settings for other user also? – Selvam R Mar 29 '13 at 6:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .