Published 29 Oct, 2022

Java - Got java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SAXSVGDocumentFactory when using Interleaved2Of5 Barcode format

Category Java
Modified : Nov 30, 2022

I am trying to print a list of barcodes, data for which which will be sent to the JasperReports jrxml in a List of Strings.

I am successful in printing the barcodes using barbeque format, but now I have to change the format of barcode to barcode4j Interleaved2Of5. I have added the following dependencies in my pom.xml:



But still getting the below error while running the code:

java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SAXSVGDocumentFactory

Can any one tell me if there is any issue with the dependecies added or I need to add any other dependecies?


There are 1 suggested solutions here and each one has been listed below with a detailed description. The following topics have been covered briefly such as Java, Jasper Reports, Batik, Noclassdeffounderror. These have been categorized in sections for a clear and precise explanation.


You can use org.apache.xmlgraphics:batik-svg-dom:1.7 artifact to fix this issue.

As you can see the class is here:

The content of package


BTW, you can use to find jar or class you need. You can check this url to get information where you can find org.apache.batik.dom.svg.SAXSVGDocumentFactory class.

enter image description here