I'm getting this stack trace when using openjdk 8 with this docker image: openjdk:8-jre-alpine
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_131]
at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_131]
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82) [rt.jar:1.8.0_131]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_131]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) [rt.jar:1.8.0_131]
at java.awt.Font.getFont2D(Font.java:491) [rt.jar:1.8.0_131]
at java.awt.Font.getFontName(Font.java:1279) [rt.jar:1.8.0_131]
at java.awt.Font.getFontName(Font.java:1261) [rt.jar:1.8.0_131]
It works fine using the Oracle version
Following some directions to install the dejavu fonts from here: https://hub.docker.com/r/neduekwunife/openjdk8-jre-alpine-with-fontconfig/
I added the following line to my Dockerfile:
RUN apk add --update ttf-dejavu && rm -rf /var/cache/apk/*
which now gives me the following error:
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/libfontmanager.so: Error relocating /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/libfontmanager.so: AWTFontDefaultChar: symbol not found