0

JasperReports 6.2.2 contains only dis folder containing jasper report .jar , dataflow.jar and font.jar while other jars as :

commons-beanutils-*.jar
commons-collections-*.jar
commons-digester-*.jar
commons-logging-*.jar
groovy-all-*.jar
itextpdf-*.jar
itext-pdfa-*.jar

are missing. So should i separately download each jar or not?

Alex K
  • 22,315
  • 19
  • 108
  • 236
salu khadka
  • 11
  • 1
  • 2
  • 1
    I would not close this question, it has a good answer from one of the developers of jasper-reports and jasper-reports users are not always familiare to how libraries are distributed, it is not missing MCVE nor is it too broad. – Petter Friberg Jun 02 '16 at 12:35

1 Answers1

1

Indeed, in recent releases we gave up distributing the third-party jars in the lib folder and instead, we are using the Apache Ivy plugin for Ant to automatically download them from public Maven repositories at source code build time or when running the samples. So you need to download them on your own from public repositories. In the next release, there will be an Ant target to retrieve them all with a simple command. Until then, copy this snippet in the build.xml file found in the root folder of your JR 6.2.2 source distro:

<target name="retrievelibs" description="Retrieve dependencies with Apache Ivy">
    <ivy:retrieve conf="compile, javaflow, test" pattern="dist/lib/[artifact](-[classifier])-[revision].[ext]"/>
</target>

If you launch >ant retrievelibs from command line, you'll have all libs required to compile JR Lib places in the /dist/lib folder of the project. Note that depending on which are of functionality you use, you'll need additional JARs. Each sample in our project distro brings additional JARs needed at runtime. You can check which JARs are needed as they are listed in the ivy.xml file of that particular sample. You can use a similar target in the build.xml of the sample to have those JARs downloaded for you.

If you are using Maven, you could launch:

>mvn dependency:copy-dependencies

command and get all dependencies including the transient ones in the target/dependecy folder of the JR project.

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
Teodor Danciu
  • 221
  • 2
  • 4
  • Thanks Teodar. but i am a student and very new to JasperSoft. So it is very difficult for me to understand these errors : Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/io/Resource at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:156) – salu khadka May 31 '16 at 13:43
  • @salukhadka, you need to download the libs and set them to class path see this question to understand [NoClassDefFoundError](http://stackoverflow.com/questions/17973970/how-to-solve-java-lang-noclassdeffounderror) – Petter Friberg Jun 02 '16 at 12:44