Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser

前端 未结 19 2256
清酒与你
清酒与你 2020-12-10 01:32

I\'m trying to display my reports on the browser , but I keep getting this error:

\"enter

19条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 01:58

    For me the issue was regarding a bug in AdoptOpenJDK: https://github.com/AdoptOpenJDK/openjdk-build/issues/682

    I fixed the issue by installing ttf-dejavu manually in my dockerfile

    FROM adoptopenjdk/openjdk8:alpine-jre
    
    # Workaround for wrong font configuration in adoptopenjdk
    # https://github.com/AdoptOpenJDK/openjdk-build/issues/682
    RUN apk update && apk upgrade \
       && apk add --no-cache ttf-dejavu \
       # Install windows fonts as well. Not required..
       && apk add --no-cache msttcorefonts-installer \
       && update-ms-fonts && fc-cache -f
    

    AND by running the application with the flag -Djava.awt.headless=true

提交回复
热议问题