Cannot load font in JRE 8

I get the same error with openjdk:8-jre-alpine. Switching to openjdk:8-jre helps.

--- FROM openjdk:8-jre-alpine
+++ FROM openjdk:8-jre

It turns out that this is a problem with the openjdk-8-jre-headless installation. This is the installation in the Docker image for java 8 JRE. I simply install openjdk-8-jre (without headless) and the problem goes away.

If you look at the error log, the loading of the font require awt X11, which is missing from headless version of JRE.


We also got that error when using tomcat:8.0.38-jre8-alpine. That image is missing the fontconfig. Instead of switching to a different image you could also install the ttf-dejavu package.

apk add --update ttf-dejavu