问题描述
我用some在我的Java应用程序的AWT code 直到我单位通过詹金斯和摇篮测试了Linux Mint的Debian的版本跑罚款:
我现在得到那个讨厌的 java.awt.HeadlessException异常
这说明<一href=\"https://www.ibm.com/developerworks/community/blogs/738b7897-cd38-4f24-9f05-48dd69116837/entry/how_to_resolve_java_exceptions_java_awt_headlessexception7?lang=en\"相对=nofollow>这里。
I use some AWT code in my Java app which ran fine until I unit tested it on Linux Mint Debian Edition via Jenkins and Gradle:I now get that nasty java.awt.HeadlessException
which is explained here.
不成功的单元测试使我的生成失败;我该如何解决呢?
The unsuccessful unit test causes my build to fail; how do I fix that?
推荐答案
这是摆脱我的HeadlessException的步骤:
These are the steps that rid me of the HeadlessException:
- 添加詹金斯
- VNC :
sudo易于得到更新和放大器;&安培; sudo易于得到安装
vnc4server - 确保詹金斯有shell:
须藤usermod命令-s /斌/ bash的詹金斯
- 请作为詹金斯:
须藤苏詹金斯
- 输入命令
vnc4server
键,选择一个密码 - 勾选
运行的Xvnc在詹金斯的构建配置构建
在
- Add the Xvnc plugin to Jenkins
- Install VNC:
sudo apt-get update && sudo apt-get installvnc4server
- Make sure Jenkins has a shell:
sudo usermod -s /bin/bash jenkins
- Log in as Jenkins:
sudo su jenkins
- Enter the command
vnc4server
and choose a password - Tick
Run Xvnc during build
in Jenkins' build config
这篇关于如何解决在java.awt.HeadlessException异常詹金斯在Linux上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!