Search code examples
jasper-reportsclassnotfoundexceptionjaspersoft-studio

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


I have connected an Oracle server with all of my tables to JasperReports through a JDBC connection, and managed to load my tables and fields on the report. I've also added the jdbc8.jar as a classpath to my new Data Adapter, but unfortunately, when I try to preview my new report, I get the following compilation error :

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

Solution

  • JasperSoft Studio to have access to external classes in jar needs these on it's classpath. To add the jar select your project node in Project Explorer and then in menu select:

    Project >> Properties

    navigate to "Java Build Path", select tab "Libraries" and then click either:

    • "Add JARs" if the jar's are in project folder
    • "Add External JARs" if they are not in project folder.

    Add jars