I'am using Oracle JDK 8u77 and when I try call the method ITF14Bean.generateBarcode(canvas, number) I get this exception:
java.lang.IllegalAccessError: tried to access field org.krysalis.barcode4j.impl.DefaultCanvasLogicHandler.bcBean from class org.krysalis.barcode4j.impl.int2of5.ITF14CanvasLogicHandler
at org.krysalis.barcode4j.impl.int2of5.ITF14CanvasLogicHandler.getITF14Bean(ITF14CanvasLogicHandler.java:42)
at org.krysalis.barcode4j.impl.int2of5.ITF14CanvasLogicHandler.startBarcode(ITF14CanvasLogicHandler.java:48)
at org.krysalis.barcode4j.impl.int2of5.Interleaved2Of5LogicImpl.generateBarcodeLogic(Interleaved2Of5LogicImpl.java:181)
at org.krysalis.barcode4j.impl.int2of5.ITF14Bean.generateBarcode(ITF14Bean.java:124)
below my code:
public InputStream gerar(String number) {
File outputFile = new File("out.jpg");
final int dpi = 150;
ITF14Bean bean = new ITF14Bean();
bean.setHeight(32);
bean.setModuleWidth(1);
bean.setWideFactor(2.5);
bean.setChecksumMode(ChecksumMode.CP_AUTO);
bean.setBearerBarWidth(0);
bean.setBearerBox(false);
OutputStream out = new FileOutputStream(outputFile);
try {
BitmapCanvasProvider canvas = new BitmapCanvasProvider(out, "image/jpeg", dpi, BufferedImage.TYPE_BYTE_BINARY, false, 0);
bean.generateBarcode(canvas, number);
canvas.finish();
} finally {
out.close();
}
return new FileInputStream(outputFile);
}
I'am using Oracle JDK 8u77 and when I try call the method ITF14Bean.generateBarcode(canvas, number) I get this exception:
below my code: