今天上午打印回单功能发布到测试环境,报了:

class java.awt.HeadlessException : No X11 DISPLAY variable was set, but this program performed an operation which requires it.

异常,经查询发现网上解决方案不少,其中解决办法大致如下:

export DISPLAY=:0.0

上面配置环境变量DIAPLAY,值为:0.0就解决了当前问题。

在这里要介绍下另一种方式

export DISPLAY=localhost:0

这种方式只能在本地使用,对于像我这样需要远程工具访问Linux的用户来说,我们是在Windows上查看web界面,并非本地用户。所以这种方式有其局限性。



												

class java.awt.HeadlessException : No X11 DISPLAY variable was set, but this program performed an operation which requires it.的更多相关文章

  1. Linux下运行Java项目时,出现No X11 DISPLAY variable was set, but this program performed an operation which requires it.的问题解决

    在~/.bashrc环境变量文件最下方加入: export DISPLAY=:0.0 然后,刷新环境变量以使其生效: source -/.bashrc 参考:http://stackoverflow. ...

  2. No X11 DISPLAY variable was set

    在命令行调用图形化界面时报错 “No X11 DISPLAY variable was set” 首先使用xclock命令查看是否能调出时钟,如果不行,使用如下命令: 打开xmanager – pas ...

  3. jenkins -Djava.awt.headless=true Linux下java.awt.HeadlessException的解决办法

    修改 linux  apache-tomcat-7.0.56/bin \catalina.sh文件 在所有类似以下代码大约有七八处具体自己去看:    "$_RUNJAVA" $J ...

  4. Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.

    刚刚在一台Linux服务器上安装了jdk和Tomcat,然后部署了一个web项目,在项目中有个添加图片的功能,保存图片时报错 org.springframework.web.util.NestedSe ...

  5. Can't connect to X11 window server using ':1.0' as the value of the DISPLAY variable.

    安装oracle数据时需要用到图形界面安装,当我们用root用户登录后切换到oracle用户时运行./runInstaller提示报错: Can't connect to X11 window ser ...

  6. Linux启动应用(比如jmeter)报An error occurred: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

    Linux启动应用(比如jmeter)报An error occurred: Can't connect to X11 window server using ':0.0' as the value ...

  7. Java AWT组件开发和Swing界面编程

    一.AWT组件开发 1.AWT AWT是抽象窗口工具箱的缩写,它为编写图形用户界面提供了用户接口,通过这个接口就可以继承很多方法,省去了很多工作.AWT还能使应用程序更好地同用户进行交互. AWT中的 ...

  8. pylab,matplotlib Invalid DISPLAY variable

    在cetos 服务器使用源码包,安装matplotlib, 安装成功后, import pylab as pl pl.figure(figsize=(16,8)) python 解析器报错,Inval ...

  9. Atitit.java图片图像处理attilax总结  BufferedImage extends java.awt.Image获取图像像素点image.getRGB(i, lineIndex); 图片剪辑/AtiPlatf_cms/src/com/attilax/img/imgx.javacutImage图片处理titit 判断判断一张图片是否包含另一张小图片 atitit 图片去噪算法的原理与

    Atitit.java图片图像处理attilax总结 BufferedImage extends java.awt.Image 获取图像像素点 image.getRGB(i, lineIndex); ...

随机推荐

  1. C#的数据类型总结(1)

    C# 是一种强类型语言.在变量中存储值之前,必须指定变量的类型,如以下示例所示: int a = 1; string s = "Hello"; XmlDocument tempDo ...

  2. linux服务器解压缩文件的命令

    尝试去好好用linux.新手起步.   这边只会提到我用过的.其他相关的以后我用到了我会补充的.如果有错欢迎指正 注:1.c-创建-create 2.v-复杂输出    3.f-文件-file     ...

  3. 使用python处理excle表格

    # -*- coding: utf-8 -*- import xlrd ########################### #通用功能,读取excel表格中所有数据 #返回一个包含所有单元格名和对 ...

  4. 》》stroll--各种特效下拉菜单

    <!doctype html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  5. db2 调整连接数的优化

    The Version 9.5 default for the max_coordagents and max_connections parameters will be AUTOMATIC, wi ...

  6. [转载]ArchLinux 添加 archlinuxcn 源 密钥错误

    http://www.jianshu.com/p/8ed688b0a096 杜龙少 正在检查密钥环里的密钥 [######################] 100% 正在下载所需的密钥...... ...

  7. 理解cocoa和cocoa touch的响应者链

    该文章翻译自:Understanding cocoa and cocoa touch responder chain. 转载注明出处:http://www.cnblogs.com/zhanggui/p ...

  8. ligerUI---ligerForm中下拉框使用

    写在前面: 最近项目的前框框架用的是ligerUI,一开始我是拒绝的,因为貌似ligerUI很少有人用,我真的很想问我们team的斌哥哥为什么要用ligerUI来做前端框架?????(啊哈哈哈,用什么 ...

  9. Linux:如何进行c++编程

    不适应美帝的饮食,当一只咸鱼在apartment里Coding一波,学习学习如何在Ubuntu实现C++的编程 正文如下: (预备知识) 学习Vim:  http://www.cnblogs.com/ ...

  10. JavaWeb之原生数据库连接

    我们在开发JavaWeb项目时,常会需要连接数据库.我们以MySQL数据库为例,IDE工具为eclipse,讲述数据库连接与基本操作. 第一步,我们在Web项目的WebContent中建一个简单的前端 ...