Simple Java QR Code Generator Example

You may also like...

Subscribe
Notify of
guest
2 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Caleb Bankole Olojo
Caleb Bankole Olojo
March 21, 2017 23:15

It doesn’t work for me. Keeps throwing error.

Exception in thread “main” java.lang.NoSuchMethodError: com.google.zxing.Writer.encode(Ljava/lang/String;Lcom/google/zxing/BarcodeFormat;IILjava/util/Map;)Lcom/google/zxing/common/BitMatrix;
at net.glxn.qrgen.QRCode.createMatrix(QRCode.java:206)
at net.glxn.qrgen.QRCode.writeToStream(QRCode.java:202)
at net.glxn.qrgen.QRCode.stream(QRCode.java:180)
at parkingSoft.QrTest2.main(QrTest2.java:18)

Please help. Thanks

Memorynotfound.com
Memorynotfound.com
March 22, 2017 09:27

For those getting the NoSuchMethodError, you probably didn’t include the correct dependencies to your project.
Make sure the net.glxn.qrgen: javase:2.0 is on your classpath.
This version includes
– com.google.zxing:javae:3.1.0
– com.google.zxing:core:3.1.0
– net.glxn.grgen:core:2.0
– org.jfree:jfreesvg:2.1

Cheers,
Memorynotfound

2
0
Would love your thoughts, please comment.x
()
x