Java 11 or later ..verifyCode。 CentOS

CentOS系统,当用的jdk的验证码相关时,针对不含有Jre的版本。可能无法生成验证吗。因为程序用到了jre的lib下fontconfig相关的文件。针对无jre的11及之后版本,可以通过使用

yum install -y fontconfig 安装相关包解决

附报错信息

java.lang.NullPointerException: null
at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:362)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312

Leave a Reply

Your email address will not be published. Required fields are marked *

lWoHvYe 无悔,专一