歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> iReport部署到Linux系統字體問題

iReport部署到Linux系統字體問題

日期:2017/2/28 16:13:17   编辑:Linux教程

使用ireport導出pdf,在Windows下,一切好好的,放到Liunx下後,導出pdf報

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

解決方法:

1、把需要用到的字體(可以直接拷貝windows系統的C:\WINDOWS\Fonts 下的相關字體)拷貝當前項目的classpath下,一般為classes目錄下

2、在classpath裡添加 jasperreports.properties 屬性文件

文件內容為:

net.sf.jasperreports.awt.ignore.missing.font=true

Copyright © Linux教程網 All Rights Reserved