简体   繁体   中英

How to fix java.awt.HeadlessException in Jenkins on Linux

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?

These are the steps that rid me of the HeadlessException:

  1. Add the Xvnc plugin to Jenkins
  2. Install VNC : sudo apt-get update && sudo apt-get install vnc4server
  3. Make sure Jenkins has a shell: sudo usermod -s /bin/bash jenkins
  4. Log in as Jenkins: sudo su jenkins
  5. Enter the command vnc4server and choose a password
  6. Tick Run Xvnc during build in Jenkins' build config

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM