Bitbucket Server installer fails to run with NullPointerException in console mode

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

When running the console installer for Bitbucket Server on a headless Linux server, the following error is thrown:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 $ ./atlassian-bitbucket-4.0.1-x64.bin -c 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:776) 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.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:422) 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:1415) at javax.swing.JEditorPane.<init>(JEditorPane.java:293) at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(Unknown Source) at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.<init>(Unknown Source) at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.<init>(Unknown Source) at com.install4j.runtime.installer.Installer.getScreenExecutor(Unknown Source) at com.install4j.runtime.installer.Installer.runInProcess(Unknown Source) at com.install4j.runtime.installer.Installer.main(Unknown Source) 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:497) at com.exe4j.runtime.LauncherEngine.launch(Unknown Source) at com.install4j.runtime.launcher.Launcher.main(Unknown Source) Could not display the GUI. This application needs access to an X Server. ******************************************************************* You can also run this application in console mode without access to an X server by passing the argument -c *******************************************************************

Cause

This is caused by the Linux server missing the fonts contained in the dejavu-sans-fonts package, which is required by the installer we use, install4j, even for the console installation.

Resolution

Install the dejavu-sans-fonts package on your linux server and run the installer again.

1 yum install dejavu-sans-fonts
1 apt-get install fonts-dejavu

If the above steps doesn't help, you need to verify whether you have installed openjdk-<version>-jre-headless instead openjdk-<vesrion>-jre.

1 2 3 4 [root@stash ~]# rpm -qa | grep java python-javapackages-3.4.1-6.el7_0.noarch javapackages-tools-3.4.1-6.el7_0.noarch java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64

If that's the case you need replace openjdk-<version>-jre-headless with openjdk-<vesrion>-jre.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.