AWTProblem Error After Migrating to Java 11

1 minute readKnowledge base

Issue

After migrating to Java 11, Jenkins fails to come up with the following error in the logs:

SEVERE hudson.util.BootFailure#publish: Failed to initialize Jenkins java.lang.NullPointerException at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262) at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225) at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107) at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719) at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:367) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:312) at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35) at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56) ... Caused: hudson.util.AWTProblem at hudson.WebAppMain.contextInitialized(WebAppMain.java:218) at com.cloudbees.jenkins.ha.HASwitcher.contextInitialized(HASwitcher.java:59) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1073) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:572) at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:1002) ...

Resolution

From the error, we can see java.desktop/sun.awt.FontConfiguration just under the NullPointerException - in this case, the fontconfig library is missing and must be installed. Installation can be performed via commands such as sudo yum install fontconfig etc. depending on your OS.

Tested product/plugin versions