H! I am writing a java proram in which I need to generate and read barcodes to and from .PNG images. I used barcode4j-2.jar library to generate barcodes and write them to PNG image. I did this successfully.
But I faced an error during reading that generated barcode from the image.
I used "OnBarcode.BarcodeReader.jar" library to read the barcode but it give s me folloiwng error:

 java.lang.NoClassDefFoundError: com/sun/media/jai/codec/SeekableStream
at a.a.b.a.a(a.java)
at a.a.d.a(d.java)
at a.a.d.a(d.java)
at a.a.d.b(d.java)
at a.a.d.a(d.java)
at a.a.d.e(d.java)
at a.a.d.c(d.java)
at a.a.d.a(d.java)
at a.a.d.a(d.java)
at OnBarcode.Barcode.BarcodeScanner.BarcodeScanner.Scan(BarcodeScanner.java)

I am pasting the code here:

  public void ReadBarcodeFromImage() throws FileNotFoundException,IOException

       // error occurs due to folloiwing line.
      String[] barcodes= BarcodeScanner.Scan(


Tell me what I am missing or doing wrong. Thanks in advance.

Recommended Answers

Maybe you need to install Java Advanced Imaging (JAI) as well.

Jump to Post

All 2 Replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.