Eclipse - Jasper report does not compile (java.lang.NoClassDefFoundError: org / apache / commons / digester / Digester)

I am trying to create a jasper report via ide Eclipse, however, when I execute the following line of code:

jasperReport = JasperCompileManager.compileReport("reports/samplereport.jrxml"); 

I get the following error:

 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:146) 

I added the apache common digester drummer as a project library, but it doesn't seem to make any difference. NOTE. I am from a java newbie (for example, I am a .NET background), so I most likely do something really obvious!

+4
source share
2 answers

You may not have some banks. try adding them with any version.

JasperReports-.jar;
JasperReports-javaflow.jar;
Common-beanutils.jar;
Common-collections.jar;
Common-logging.jar;
commons-digester.jar

+8
source

If your project is based on maven, you can add Jasper reports as a dependency on maven, see an example code snippet below. A Jasper report automatically imports all the libraries in which it should run.

 ... <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>6.4.1</version> </dependency> ... 
+1
source

All Articles