新闻正文

AWT与Linux环境

来源:JAVA天堂  JAVA学习者  2007-6-21 02:28:56 网友评论 0 条 字体:[ ] ~我要投稿!
BBS 水木清华站 (Sun Dec 29 17:23:20 2002)
转信站: SJTU!news.neu.edu.cn!maily.cic.tsinghua.edu.cn!SMTH
Q: What does "... Can"t connect to X11 window server using ":0.0" as the
value of the DISPLAY variable" mean?
A: This error may occur if you run Reports and Bugzero is installed on a
linux/Unix system. The exception is thrown in Unix environments by the Java
AWT toolkit when it can"t make a connection to a X11 server. Make sure that you have
your local X11 running, and that the reported DISPLAY environment variable value
is as expected.
An alternative (recommended):
If you do not run X Windows (the case for most of the server
machines), you can
install Xvfb (X Virtual Frame Buffer).
In your launch script (such as tomcat.sh), add the following lines:
if [ -f /usr/X11R6/bin/Xvfb ]; then
/usr/X11R6/bin/Xvfb :1 -screen 0 1x1x8 > /dev/null 2>&1 &
fi
export DISPLAY=:1.0

【 在 stupidboy (三蛋——笨蛋、坏蛋、混蛋) 的大作中提到: 】
: 运行环境:Tomcat4.0.1 + RedHat7.3
: 用到了JFreechart,通过Servlet生成动态统计图。
: 如果Tomcat 是在KDE里面启动的,画图,如果在系统启动时通过rc.local启动的,
: 则不能正确画图,提示DISPLAY环境变量错误,
: (localhost_log.2002-12-29.txt)
: java.lang.InternalError: Can"t connect to X11 window server using "192.
: 168.0.2:0.0" as the value of the DISPLAY variable.
: (catalina.out)
: Xlib: connection to "192.168.0.2:0.0" refused by server^M
: Xlib: No protocol specified

※ 修改:·stupidboy 于 Dec 29 17:23:20 修改本文


收藏到ViVi   收藏此页到365Key
上一篇: Jsp问题
下一篇: 怎么连oracle数据库?
用户名:新注册) 密码: 匿名评论 [所有评论]
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
本栏搜索
  • Google
   网站首页 -  网站地图 -  技术学习 -  网站投稿 -  帮助中心
Copyright 2003-2008 www.javah.net All Rights Reserved
2008 如果你喜欢本站 请收藏本站 并推荐给你的朋友一起分享