alpine缺少FontConfiguration报空指针

警告
本文最后更新于 2020-11-27 13:23,文中内容可能已过时。

报错

1
2
3
4
5
6
7
8
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)

安装ttf-dejavu

dockerfile

1
2
3
4
5
FROM openjdk:8u212-jdk-alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add ttf-dejavu tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata && rm -rf /var/cache/apk/*
请我喝杯水
SoulChild 微信号 微信号
SoulChild 微信打赏 微信打赏
0%