centos5.5启动eclipse报错Gtk-WARNING **: cannot open display: :0.0

来源:互联网 发布:linux smp 中断 编辑:程序博客网 时间:2024/06/04 08:46

通过yum install eclipse*安装了eclipse,

执行eclipse报错:

Gtk-WARNING **: cannot open display: :0.0


原因是没有可用的xwindow. 可能服务器已有应用占用了xwindow

解决方法,可在PC上安装cygwin/X11(xinit和xorg-server)

然后启动PC上的xserver: startxwin

iefreer@iefreer-THINK /usr/bin$ startxwinWelcome to the XWin X ServerVendor: The Cygwin/X ProjectRelease: 1.13.0.0OS: CYGWIN_NT-6.1 iefreer-THINK 1.7.17(0.262/5/3) 2012-10-19 14:39 i686OS: Windows 7 Service Pack 1 [Windows NT 6.1 build 7601] (Win32)Package: version 1.13.0-1 built 2012-09-06XWin was started with the following command line:X :0 -multiwindow

然后在centos服务器上设置DISPLAY到PC上的XWindow

export DISPLAY:192.168.1.87:0.0 (假设你的PC IP地址为192.168.1.87)

最后启动eclipse, 如报错服务器拒绝连接, 需要在PC上执行如下命令把eclipse所在的主机添加到XWindow的访问列表中:

xhost + 192.168.1.152 (your centos ip)


iefreer


原创粉丝点击