Atom installation in Linux is different from that of a windows system. Assuming that you are trying to install atom in Linux Red hat 7.4 version running on AWS EC2 instance , there would be exception occurred while attempting to run atom installer. Assume it is a 64 bit installer and you are not using Amazon Linux, rather choosing to use Red Hat Linux 7.4 , there could be some jar level changes to be done in Linux java home.
- Operating System: Red Hat Enterprise Linux version 7.4
java.lang.ArrayIndexOutOfBoundsException: 0 at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:75) at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93) at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359) at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350) at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302) 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)
RHEL v7.4 (upgraded from v7.3 or fresh install) comes with package stix-fonts. When this package is installed, the default font changed from Utopia to STIX. For whatever reason, the STIX fonts do not seem to play well with java and cause exceptions.
Steps to handle exception:
The Exception message states that there is sun.font.* jar which is missing its way onto atom installation steps. As AWS provides open jdk and Redhat 7.4 does not support the required font in Open JDK, we need to overwrite the setting by creating local font configuration file. Open the fonts.dtd and change the stix font to default font Uthopia. Or follow the steps below:
- Create a file name /etc/fonts/local.conf
Insert the following configuration into the file in order to force back Utopia as the default font, used by java.
Download the installer and run sh ./atom_install64.sh . The atom will now get installed in linux. If there is any other new exception occurring related to a particular jar in Linux java_home then try to edit the install64.sh in Notepad++ by adding !/bin/sh -x in first line. This will enable installer level debug mode and you will see exceptions.