We can produce the same exception on Alpine docker with openjdk17 installed:
# Start with the bare Alpine base image
FROM alpine:latest
# Set environment variables for Java
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk \
PATH=$JAVA_HOME/bin:$PATH
# Install only the minimal OpenJDK 17 package
RUN apk add --no-cache openjdk17-jdk \
&& java -version
We tried to handle some exceptions, but it breaks lots of places which are related to Font while rendering text.
After installing packages fontconfig
and ttf-dejavu
, it works OK. We tried some solutions, but only this one works.