linux异常系列:Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
来源:互联网 发布:ibm 云计算 编辑:程序博客网 时间:2024/06/05 05:18
在linux上在画图和chart时好多人会碰到Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
原因:因为用到了图形处理,java程序会去寻找linux上的图形界面是否启动
解决:不让java寻找linux图形界面即可,在java启动时加选项java -Djava.awt.headless=true
解决:
在.bash_profile 加了个export JAVA_OPTS=-Djava.awt.headless=true
以下为另一种方式,试了没有效果
实现:如果是tomcat,在/usr/local/tomcat/bin/catalina.sh中修改为
JAVA_OPTS=-Djava.awt.headless=true
echo "Using CATALINA_BASE: $CATALINA_BASE"
echo "Using CATALINA_HOME: $CATALINA_HOME"
echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
echo "Using RUNJAVA: $_RUNJAVA"
echo "Using JAVA_OPTS: $JAVA_OPTS"
java将不需检测,问题自然解决。
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
只在重启时才会出现,重启一次tomcat,kill tomcat进程就可以了
源文档 <http://www.linuxdiyf.com/viewarticle.php?id=110580>
- linux异常系列:Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable解决办法
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable解决方法
- ORACLE EBS:Can't connect to X11 window server using '**' as the value of the DISPLAY variable.
- Linux上 Can't connect to X11 window server using XX as the value of the DISPLAY 错误解决方法
- 服务器Tomcat启动 访问出现Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLA
- Can't connect to X11 window server using ':0.0'
- linux异常系列:Can't connect to X11 window
- 装ORACLE时 Can't connect to X11 window server using ':0.0' 解决方法
- Can't connect to X11 window server using 'localhost:0.0' 的解决
- Can't connect to X11 window server using 'localhost:0.0' 的解决
- 【Vegas原创】Can't connect to X11 window server using ':0.0' 解决方法
- 【Vegas原创】Can't connect to X11 window server using ':0.0' 解决方法
- Can't connect to X11 window server using 'localhost:0.0' 的解决
- 项目上线那些事之Can't connect to X11 window server异常
- 安装oracle, can't connect to X11 window server
- Nagios的进程监控及eventhandler之实战
- Java 通过URL获取网站Html源代码
- RAKNET RPC3 Plugins - Remote Procedure Calls With Boost 远程功能调用
- SD卡升级——SDIO IAP实验
- 《深入理解JAVA虚拟机》--第二章 Java内存溢出异常
- linux异常系列:Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
- opencart页面打开效率优化
- linux双网卡双网关,不同IP段的设置
- JS中setTimeout()的用法详解
- 只复制表结构不复制内容
- Maven使用中的常见问题整理
- SELECT INTO 和 INSERT INTO SELECT 两种表复制语句
- linux异常系列:linux局域网不能访问本机
- 使用GDB调试Coredump文件