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(
       "C:\\Users\\hp430\\Desktop\\BarcodeImage\\"+"sunsoftbarcodes.png",
         BarcodeType.Code128);

     }

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

Recommended Answers

All 2 Replies

Be a part of the DaniWeb community

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