How to Use Java Barcode Reader API

Dynamsoft’s Barcode Reader SDK is a cross-platform bar code detection and decoding library. With the barcode scanning SDK, developers could easily build Java barcode applications on Windows, Linux, and macOS.

The Complete SDK Package

Get 30-day free trial of Dynamsoft Barcode Reader SDK >

Java Barcode SDK

Java Barcode Quick Start

A dynamsoft-barcodereader-7.5.jar file is located under the Dynamsoft Barcode Reader\lib folder. You can easily import the jar file to your Java IDE (e.g. Eclipse). If you are using a Maven project, to add the dependency, you need to edit the pom.xml file as follows:

         <id>dbr </id>
         <url> </url>

Here is the code snippet showing how to decode barcodes from an image file:

import com.dynamsoft.barcode.*;

public class App {
    public static void main(String[] args) {
        String filename = "<file path>";
        try {
            BarcodeReader reader = new BarcodeReader(
                    "<Your trial license>");
            TextResult[] results = reader.decodeFile( filename, "");
            for (TextResult result : results) {
        } catch (Exception e) {
            // TODO: handle exception


For more advanced usage, please read the online documentation.

API Reference

SDK License

To fully experience the functionalities of the SDK, please get a valid trial license.


Get more Java barcode scanning samples >

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.