紫衣飞扬
2016-09-02 17:40
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at com.google.zxing.common.CharacterSetECI.getCharacterSetECIByName(CharacterSetECI.java:114)
at com.google.zxing.qrcode.encoder.Encoder.encode(Encoder.java:95)
at com.google.zxing.qrcode.QRCodeWriter.encode(QRCodeWriter.java:80)
at com.google.zxing.MultiFormatWriter.encode(MultiFormatWriter.java:94)
at com.imooc.zxing.CreateQRCode.main(CreateQRCode.java:30)
总是报这个错
源码里面有问题 找到错误 改一些 重新打个jar包
String contents = null;
try {
BitMatrix bitmatrix =new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE , width, height,hints);
BitMatrix bitmarix;
Path file = new File("D:/img.png").toPath();
//. topath 报错怎么回事啊
MatrixToImageWriter.writeToPath(bitmatrix, format, file);
} catch (Exception e) {
e.printStackTrace();
}
String contents = null;
try {
BitMatrix bitmatrix =new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE , width, height,hints);
BitMatrix bitmarix;
// Path file = new File("D:/img.png").toPath();
报错在, 回事啊,请指教
MatrixToImageWriter.writeToPath(bitmatrix, format, file);
} catch (Exception e) {
e.printStackTrace();
}
仔细检查下代码!
然后你用命令试下代码;在cmd下
错误是编译错误,JDK版本说下
Java生成二维码
84502 学习 · 204 问题
相似问题