Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251367

[windows] harfbuzz.dll not found causes failure to load sun.font.SunFontManager

XMLWordPrintable

    • 2d
    • 16
    • b12

      With JDK 16 a jpackage installed swing app is failing with

      Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager

      This appears to be a regression due to
      8249821: Separate libharfbuzz from libfontmanager

      so harfbuzz.dll is now a dependent dll of libfontmanager.dll, as
      was already the case for freetype.dll

      This isn't seen in apps using the java launcher, but jpackage must
      not be setting up the path the same way.

      I observe that in src/java.desktop/share/classes/sun/font/FontManagerNativeLibrary.java
      for windows we have code like this
                     if (System.getProperty("os.name").startsWith("Windows")) {
                         System.loadLibrary("freetype");
                     }
                     System.loadLibrary("fontmanager");

      along with comments about windows dll loading not being able to find
      freetype without this.

      The same is therefore needed for harfbuzz.

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: