class java.awt.HeadlessException : No X11 DISPLAY variable was set, but this program performed an operation which requires it.
今天上午打印回单功能发布到测试环境,报了:
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.的更多相关文章
- 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. ...
- No X11 DISPLAY variable was set
在命令行调用图形化界面时报错 “No X11 DISPLAY variable was set” 首先使用xclock命令查看是否能调出时钟,如果不行,使用如下命令: 打开xmanager – pas ...
- jenkins -Djava.awt.headless=true Linux下java.awt.HeadlessException的解决办法
修改 linux apache-tomcat-7.0.56/bin \catalina.sh文件 在所有类似以下代码大约有七八处具体自己去看: "$_RUNJAVA" $J ...
- 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 ...
- 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 ...
- 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 ...
- Java AWT组件开发和Swing界面编程
一.AWT组件开发 1.AWT AWT是抽象窗口工具箱的缩写,它为编写图形用户界面提供了用户接口,通过这个接口就可以继承很多方法,省去了很多工作.AWT还能使应用程序更好地同用户进行交互. AWT中的 ...
- pylab,matplotlib Invalid DISPLAY variable
在cetos 服务器使用源码包,安装matplotlib, 安装成功后, import pylab as pl pl.figure(figsize=(16,8)) python 解析器报错,Inval ...
- 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); ...
随机推荐
- iOS生成Bundle包及使用
什么是Bundle文件? 简单理解,就是资源文件包.我们将许多图片.XIB.文本文件组织在一起,打包成一个Bundle文件.方便在其他项目中引用包内的资源. Bundle文件的特点? Bundle是静 ...
- javascript设计模式——命令模式
前面的话 假设有一个快餐店,而我是该餐厅的点餐服务员,那么我一天的工作应该是这样的:当某位客人点餐或者打来订餐电话后,我会把他的需求都写在清单上,然后交给厨房,客人不用关心是哪些厨师帮他炒菜.餐厅还可 ...
- google guava cache缓存基本使用讲解
代码地址:https://github.com/vikde/demo-guava-cache 一.简介 guava cache是google guava中的一个内存缓存模块,用于将数据缓存到JVM内存 ...
- 读取 DisplayName和Display(Name='')
public class UserClass { [DisplayName("名称")] //DisplayName public ...
- google开源服务器apprtc的搭建
本文参考网帖: http://www.jianshu.com/p/c55ecf5a3fcf http://io.diveinedu.com/2015/02/05/%E7%AC%AC%E5%85%AD% ...
- Docker笔记四:Elasticsearch实例部署
在运行或启动elasticsearch容器前,先在宿主机上执行 sysctl -w vm.max_map_count=262144: 解决" max virtual memory areas ...
- vue init失败解决方案-终极版
//由于windows系统的某方面问题,vue脚手架安装可能会出现第一证书丢失 // 报错:vue-cli · Failed to download repo vuejs-templates/webp ...
- [Sqoop]利用sqoop对mysql运行DML操作
业务背景 利用sqoop对mysql进行查询.加入.删除等操作. 业务实现 select操作: sqoop eval \ --connect jdbc:mysql://127.0.0.1:3306/m ...
- Android音频: 怎样使用AudioTrack播放一个WAV格式文件?
翻译 By Long Luo 原文链接:Android Audio: Play a WAV file on an AudioTrack 译者注: 1. 因为这是技术文章,所以有些词句使用原文,表达更准 ...
- RedHat Linux AS4 DNS 配置
RedHat Linux AS4 DNS配置 检查当前系统中安装 DNS功能组件bind情况 [root@svr01 /]# rpm -qa|grep bind* ypbind-1.17.2 ...