Ok, I found the solution. 1) Replace the barcode4j jar with the new version. 2) Add the avalon framework dependency 3)Create a custom java class using barcode4j lib with a static method that generate the barcode and return an input stream. 4) Export the jar. 5)Add the jar to I-Report 6) Add a nimmage in I-Report, set the expression class as InputStream, use the custom class method in the Expression Image. It works fine in I - Report and Jasper Server too. .