1

I'm trying to make a small Java application with UI and run it on Arch Linux ARM, but every time I try rendering a text, it crashes with the following error:

Exception in thread "AWT-EventQueue-0" 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)

After some debugging I noticed the FontManager is looking for the file /usr/lib/jvm/java-8-openjdk/jre/lib/fontconfig.properties, which is not present on my system despite having installed both libfontconfig:

[root@raspberry-pawel jezor]# pacman -Q | grep font
cantarell-fonts 1:0.100-1
fontconfig 2.12.6+5+g665584a-1
fontsproto 2.1.3-2
libfontenc 1.1.3-1
libxfont2 2.0.3-1
xorg-font-util 1.3.1-1
xorg-font-utils 7.6-4
xorg-fonts-100dpi 1.0.3-3
xorg-fonts-75dpi 1.0.3-3
xorg-fonts-alias 1.0.3-1
xorg-fonts-encodings 1.0.4-4
xorg-mkfontdir 1.0.7-8
xorg-mkfontscale 1.1.2-1

and non-headless JRE:

[root@raspberry-pawel jezor]# pacman -Q | grep jre
jre8-openjdk 8.u111-1
jre8-openjdk-headless 8.u111-1

Why this file could be missing? What is usually generating it (on my laptop it contains a comment "Java generated do not touch")? How can I generate it myself?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.