最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用zxing生成二維碼編譯不通過(guò)

使用zxing生成二維碼編譯不通過(guò)

guanghui123 2018-07-19 15:03:08
package?zSave; import?java.io.File; import?java.io.IOException; import?java.nio.file.Path; import?java.util.HashMap; import?java.util.Map; import?com.google.zxing.BarcodeFormat; import?com.google.zxing.EncodeHintType; import?com.google.zxing.MultiFormatWriter; import?com.google.zxing.WriterException; import?com.google.zxing.client.j2se.MatrixToImageWriter; import?com.google.zxing.common.BitMatrix; public?class?ZxingQrCodeUtil?{ ? ??public?static?void?main(String[]?args)?throws?WriterException,?IOException?{ ??int?width=300;; ??String?contents="png"; ??int?height=300; ??String?format="http://baidu.com";//也可以寫(xiě)中文 ??//定義二維碼參數(shù) ??Map<EncodeHintType,Object>?hints=new?HashMap<EncodeHintType,Object>() ??hints.put(EncodeHintType.CHARACTER_SET,"utf-8"); ??? //錯(cuò)誤行--->??BitMatrix?bitMatrix=new?MultiFormatWriter().encode(contents,?BarcodeFormat.QR_CODE,?width,?height,?hints);?? ?? ??File?file=new?File("E://QR_test."+format); ??Path?p=new?File("E://QR_test2."+format).toPath();/*?if?(!file.exists())?{???file.createNewFile();??}*/?MatrixToImageWriter.writeToPath(bitMatrix,?format,?p);?System.out.println("生成成功");?}?}上面是代碼,下面是錯(cuò)誤信息: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:96)?at com.google.zxing.qrcode.QRCodeWriter.encode(QRCodeWriter.java:78)?at com.google.zxing.MultiFormatWriter.encode(MultiFormatWriter.java:102)?at zSave.ZxingQrCodeUtil.main(ZxingQrCodeUtil.java:40)我的encode()方法里的參數(shù)?BarcodeFormat.QR_CODE不能用,一用就出現(xiàn)上面的錯(cuò)誤,是運(yùn)行的時(shí)候出錯(cuò),查了但不知道具體解決辦法,說(shuō)是語(yǔ)法錯(cuò)誤???,這里請(qǐng)各位大神幫忙解答? 。
查看完整描述

目前暫無(wú)任何回答

  • 0 回答
  • 0 關(guān)注
  • 1318 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)