Cannot load font in JRE 8

后端 未结 7 1988
别那么骄傲
别那么骄傲 2020-12-15 06:10

I cannot load a font from an S3 Inputstream in JRE 8. I do not have issue if a system is installed with JRE 7, JDK 7, or even JDK 8.

val fontInputStream = s3         


        
相关标签:
7条回答
  • 2020-12-15 06:47

    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
    
    0 讨论(0)
  • 2020-12-15 06:59

    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
    
    0 讨论(0)
  • 2020-12-15 07:02

    I spent days suffering with it until I saw this github thread and made the night happy. it's practically calling GraphicsEnvironment again

    link here

    0 讨论(0)
  • 2020-12-15 07:07

    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.

    0 讨论(0)
  • 2020-12-15 07:08

    On CentOS headless JRE is missing the fontconfig dependency:

    yum install fontconfig
    

    Also one might need to install at least one font (dejavu, liberation, etc).

    0 讨论(0)
  • 2020-12-15 07:09

    For me this resolved issue:

    apt-get install -y libfontconfig1
    
    0 讨论(0)
提交回复
热议问题