Confluence Server 6.13 or later fails with FontConfiguration error when installing on Linux operating systems

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.

Problem

When installing Confluence Server or Data Center 6.13 or later with AdoptOpenJDK on Linux, installation fails with the following error. 

Starting Installer ...
java.lang.NullPointerException
    at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
    at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
    at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
    at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
    at sun.font.SunFontManager$2.run(SunFontManager.java:431)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.SunFontManager.<init>(SunFontManager.java:376)
    at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
    at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    at sun.font.SunFontManager.getInstance(SunFontManager.java:250)
    at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
    at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1113)
    at javax.swing.JComponent.getFontMetrics(JComponent.java:1626)
    at javax.swing.text.WrappedPlainView.updateMetrics(WrappedPlainView.java:318)
    at javax.swing.text.WrappedPlainView.updateChildren(WrappedPlainView.java:297)
    at javax.swing.text.WrappedPlainView.insertUpdate(WrappedPlainView.java:463)
    at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1610)
    at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1869)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:201)
    at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:748)
    at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
    at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
    at javax.swing.text.DefaultEditorKit.read(DefaultEditorKit.java:273)
    at javax.swing.JEditorPane.setText(JEditorPane.java:1416)
    at javax.swing.JEditorPane.<init>(JEditorPane.java:290)
    at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:68)
    at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.<init>(ConsoleScreenExecutor.java:24)
    at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.<init>(InstallerConsoleScreenExecutor.java:6)
    at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
    at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:57)
    at com.install4j.runtime.installer.Installer.main(Installer.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)

Cause

AdoptOpenJDK does not include a font configuration package, which Confluence relies on. Our installer has a script which will attempt to install the required font configuration package in the most common Linux distributions, however if your Linux distribution is not covered by our script, and does not include a suitable font configuration package, you will need to install one manually. 

Resolution

To solve this problem, install fontconfig (or an equivalent), and then install Confluence.  Refer to the documentation for your Linux distribution or preferred package manager for information on how to do this.

Here are the commands to install font dependency in a number of common Linux distributions and package managers. (Installing the below package may need an instance restart).

Ubuntu 

To install the fontconfig package on Ubuntu 18:

sudo apt install -y fontconfig

CentOS

CentOS 7 does not work with fontconfig. You can install dejavu-sans-fonts as an alternative:

sudo yum install -y dejavu-sans-fonts

RHEL 

To install fontconfig on RedHat Enterprise Linux 7.5:

sudo yum install fontconfig
Later versions, including RHEL8, should also work similarly.

On RHEL 6, it might be necessary to install both the dejavu-sans-fonts and the fontconfig packages:

sudo yum install -y dejavu-sans-fonts

Debian 

To install the fontconfig package on Debian 9.5:

apt-get update && apt-get install -y fontconfig

Fedora

To install the fontconfig package on Fedora 28:

dnf install -y fontconfig


Known issues

  • You can't use the Linux installer to install Confluence on OpenSUSE. You will need to install Confluence manually using the archive file. See  CONFSERVER-57895 - Getting issue details... STATUS  


Last modified on Sep 27, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.