Linux installer fails with "java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment" error

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 Linux installer, it fails with the following error message:

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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 # ./atlassian-bitbucket-4.14.4-x64.bin Starting Installer ... X11 connection rejected because of wrong authentication. java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.Toolkit$2.run(Toolkit.java:860) at java.awt.Toolkit$2.run(Toolkit.java:855) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854) at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2020) at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158) at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431) at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148) at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577) at javax.swing.UIManager.setLookAndFeel(UIManager.java:539) at javax.swing.UIManager.setLookAndFeel(UIManager.java:579) at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349) at javax.swing.UIManager.initialize(UIManager.java:1459) at javax.swing.UIManager.maybeInitialize(UIManager.java:1426) at javax.swing.UIManager.getUI(UIManager.java:1006) at javax.swing.JPanel.updateUI(JPanel.java:126) at javax.swing.JPanel.<init>(JPanel.java:86) at javax.swing.JPanel.<init>(JPanel.java:109) at javax.swing.JPanel.<init>(JPanel.java:117) at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:50) at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67) 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:92) at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58) at com.install4j.runtime.installer.Installer.main(Installer.java:46) 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:65) at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57) An error occurred: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment Error log: /tmp/install4jError5929294872178657913.log java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.Toolkit$2.run(Toolkit.java:860) at java.awt.Toolkit$2.run(Toolkit.java:855) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854) at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2020) at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158) at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431) at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148) at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577) at javax.swing.UIManager.setLookAndFeel(UIManager.java:539) at javax.swing.UIManager.setLookAndFeel(UIManager.java:579) at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349) at javax.swing.UIManager.initialize(UIManager.java:1459) at javax.swing.UIManager.maybeInitialize(UIManager.java:1426) at javax.swing.UIManager.getUI(UIManager.java:1006) at javax.swing.JPanel.updateUI(JPanel.java:126) at javax.swing.JPanel.<init>(JPanel.java:86) at javax.swing.JPanel.<init>(JPanel.java:109) at javax.swing.JPanel.<init>(JPanel.java:117) at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:50) at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67) 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:92) at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58) at com.install4j.runtime.installer.Installer.main(Installer.java:46) 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:65) at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)

Cause

This error can be caused by various factors.

Resolution

There are actually five possible resolutions:

  1. Make sure that you are not running out of disk space

    Run df and make sure you have sufficient disk space:

    1 $ df -H

    If you are low on disk space remove unnecessary files from your system or increase the disk size.

  2. Make sure that ~/.Xauthority is owned by you

    Run the following command to find ownership:

    1 $ ls -l ~/.Xauthority

    Run chown and chmod to fix permission problems:

    1 2 $ chown user:group ~/.Xauthority $ chmod 0600 ~/.Xauthority

    Replacing user:group with your actual user name and group name.

  3. Make sure that X11 SSHD forwarding is enabled

    Make sure that the following line exists in sshd_config file:

    1 $ grep X11Forwarding /etc/ssh/sshd_config

    Sample output:

    1 X11Forwarding yes

    If X11 is disabled then add the following line to sshd_config and restart the ssh server:

    1 X11Forwarding yes
  4. Make sure that X11 client forwarding is enabled

    Make sure your local ssh_config has the following lines:

    1 2 Host * ForwardX11 yes

    Finally, login to the remote server and run X11 as follows from your Linux system:

    1 ssh -X user@remote.box.example.com xeyes
  5. Prevent X11 altogether with "-x" (lowercase)

    1 ssh -x user@remote.box.example.com

    This will allow you to start/complete the install all via the command line, negating the need for X11

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.