JDK11 does not have a fonts directory

Solution Verified - Updated -

Issue

  • When migrating from Java 8 to Java 11 there is no Java fonts directory.
  • Get the following error migrating from JDK8 to JDK11:
Caused by: java.lang.NullPointerException
        at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262) ~[?:?]
        at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225) ~[?:?]
        at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[?:?]
        at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719) ~[?:?]
        at sun.font.SunFontManager$2.run(SunFontManager.java:377) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at sun.font.SunFontManager.<init>(SunFontManager.java:322) ~[?:?]
        at sun.awt.FcFontManager.<init>(FcFontManager.java:35) ~[?:?]
        at sun.awt.X11FontManager.<init>(X11FontManager.java:56) ~[?:?]

Environment

  • Red Hat Enterprise Linux (RHEL)
  • OpenJDK 11
    • Red Hat build of OpenJDK 11
    • Oracle JDK 11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content