目 录CONTENT

文章目录

java程序缺少FontConfiguration报空指针

xlong
2024-03-24 / 0 评论 / 0 点赞 / 20 阅读 / 916 字 / 正在检测是否收录...

java缺少 FontConfiguration 报空指针

Caused by: java.lang.NullPointerException: null
        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)

解决方法: 安装字体服务

# apline 安装字体服务
apk add --update ttf-dejavu fontconfig

0

评论区