当预览选项卡抛出 ClassNotFoundException 时,如何添加我的 class/jar?

How do I add my class/jar when the preview tab is throwing ClassNotFoundException?

我已经通过 JDBC 连接将带有我所有表的 Oracle 服务器连接到 JasperReports,并设法在报表上加载我的表和字段。我还将 jdbc8.jar 作为类路径添加到我的新数据适配器,但不幸的是,当我尝试预览我的新报告时,出现以下编译错误:

java.lang.ClassNotFoundException: oracle.jdbc.OracleClob cannot be found by net.sf.jasperreports_6.6.0.final --- net.sf.jasperreports.engine.design.JRDesignField@47bae235

JasperSoft Studio 要访问 jar 中的外部 类,需要在其类路径中添加这些。在 Project Explorer 中添加 jar select 您的项目节点,然后在菜单 select:

Project >> Properties

导航至 "Java Build Path"、select 选项卡 "Libraries",然后单击:

  • "Add JARs" 如果 jar 在项目文件夹中
  • "Add External JARs" 如果它们不在项目文件夹中。