Search code examples
javapythonzxing

Could not find or load main class com.google.zxing.client.j2se.CommandLineRunner


I'm trying to install Python-Zxing a Python wrapper for zxing, which is a library for reading barcodes, and qr codes. I have installed it as described in the documentation, but each time I try to run it I get the following error:

Error: Could not find or load main class com.google.zxing.client.j2se.CommandLineRunner

Here is the code I'm trying to run:

from zxing import *

b = BarCode

reader = BarCodeReader("users/myusername/python/zxing-1.6")

barcode = reader.decode("users/myusername/python/sample.png")

print(barcode)

and the result I get:

Error: Could not find or load main class    com.google.zxing.client.j2se.CommandLineRunner
<zxing.BarCode instance at 0x10225f0e0>

Does anyone have an idea what I'm doing wrong? As a beginner I'm quite lost on this one…


Solution

  • I eventually found a solution to the problem myself. For anyone with the same problem, my instructions are included in the Git repository of the projects. The problem was that the main zxing library was not properly installed, and the installation method had change to use Maven to install certain parts of the library.