linux服务器部署ireport项目
出现 Font ‘微软雅黑’ is not available to the JVM. See the Javadoc for more details.
网上说的添加linux字体库,但是我是docker容器,而且没有字体插件,内网环境无法安装;直接导入微软雅黑并不生效
于是发现可以从项目层面进行解决
解决办法:
1、把需要用到的字体(可以直接拷贝windows系统的C:/Windos/Fonts 下的相关字体)拷贝当前项目的根目录下(如:springboot项目的resource文件夹下)
2、在resource里添加 jasperreports.properties 属性文件
文件内容为:
net.sf.jasperreports.awt.ignore.missing.font=true
3、重新部署服务,报错消失、问题解决