欢迎光临散文网 会员登陆 & 注册

解决 Font '宋体' is not available to the JVM

2023-03-26 12:37 作者:库尔--  | 我要投稿

CentOS 中部署JasperReport时出错:

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '宋体' is not available to the JVM. See the Javadoc for more details.


原因:操作系统默认语言是英文版的。修改为中文并拷贝windows的字体到linux系统中并应用,重启应用服务器即可。

解决方法:

1、把需要用到的字体(可以直接拷贝windows系统的C:\WINDOWS\Fonts 下的相关字体)拷贝当前项目的classpath下,一般为classes目录下

2、在classpath里添加 jasperreports.properties 属性文件

文件内容为:net.sf.jasperreports.awt.ignore.missing.font=true

3、重启应用服务器

如若转载,请注明出处:开源字节   https://sourcebyte.vip/article/303.html


解决 Font '宋体' is not available to the JVM的评论 (共 条)

分享到微博请遵守国家法律