Check this Java barcode scanning library out. scan and read 1D (linear) and 2D (matrix) barcodes from image files
You can embed barcode recognition features in your Java Server Side Environment (JSP, Servlet, J2EE, Web Service) or yourJava Application (Swing, Applet, Java Bean, J2SE)
Here is the sample code.
String[] datas = BarcodeReader.read(new File("C:/YourBarcodeImage.gif"), BarcodeReader.EAN8);
Pass your barcode image file, and barcode type to BarcodeReader, and it will return barcode datas. Complete demo source code is under test-src folder.