Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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 Answer 1

  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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.