gpt4 book ai didi

java - Zxing用J​​ava 1.5编译2.0

转载 作者:行者123 更新时间:2023-12-01 17:32:27 26 4
gpt4 key购买 nike

嗨,我必须使用 javase zxing 模块。我已阅读zxing getting start我尝试编译 core 和 javase 模块(使用 JDK 1.5.0_22)

我在 core 文件夹中运行 ant 脚本,出现此错误:

[javac] javac: invalid target release: 6

如果我修改 core 文件夹中的 ant 脚本 build.xml,将 target=6 替换为 target=5source= 6source=5 我有 42 个编译错误:

init:

build:
[javac] Compiling 169 source files to D:\ZXing-2.0\zxing-2.0\core\build
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\MultiFormatReader.j
ava:52: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\MultiFormatReader.j
ava:66: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\MultiFormatReader.j
ava:157: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\MultiFormatWriter.j
ava:40: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\MultiFormatWriter.j
ava:48: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\aztec\AztecReader.j
ava:52: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\aztec\AztecReader.j
ava:57: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\aztec\AztecReader.j
ava:89: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\datamatrix\DataMatr
ixReader.java:57: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\datamatrix\DataMatr
ixReader.java:62: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\datamatrix\DataMatr
ixReader.java:89: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\datamatrix\detector
\Detector.java:444: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\maxicode\MaxiCodeRe
ader.java:58: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\maxicode\MaxiCodeRe
ader.java:63: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\maxicode\MaxiCodeRe
ader.java:84: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\ByQuadrantRea
der.java:46: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\ByQuadrantRea
der.java:52: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\ByQuadrantRea
der.java:95: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\GenericMultip
leBarcodeReader.java:55: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\GenericMultip
leBarcodeReader.java:60: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\QRCodeReader
.java:61: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\QRCodeReader
.java:66: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\QRCodeReader
.java:93: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\qrcode\QRCode
MultiReader.java:47: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\qrcode\QRCode
MultiReader.java:52: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\detector\Fin
derPatternFinder.java:557: method does not override a method from its superclass

[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\detector\Fin
derPatternFinder.java:573: method does not override a method from its superclass

[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\multi\qrcode\detect
or\MultiFinderPatternFinder.java:80: method does not override a method from its
superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\OneDReader.jav
a:47: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\OneDReader.jav
a:53: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\OneDReader.jav
a:87: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\OneDimensional
CodeWriter.java:40: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\OneDimensional
CodeWriter.java:53: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\UPCAWriter.jav
a:36: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\oned\UPCAWriter.jav
a:42: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\pdf417\PDF417Reader
.java:53: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\pdf417\PDF417Reader
.java:58: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\pdf417\PDF417Reader
.java:76: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\pdf417\encoder\PDF4
17Writer.java:32: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\pdf417\encoder\PDF4
17Writer.java:41: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\QRCodeWriter
.java:40: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] D:\ZXing-2.0\zxing-2.0\core\src\com\google\zxing\qrcode\QRCodeWriter
.java:47: method does not override a method from its superclass
[javac] @Override
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 42 errors

BUILD FAILED
D:\ZXing-2.0\zxing-2.0\core\build.xml:37: Compile failed; see the compiler error
output for details.

谢谢

最佳答案

这是 Java 6 语法,Java 5 javac 无法解析。

安装并使用具有 Java 6 javac 的 Java 6 JDK。

(如果您无法做到这一点,您可以尝试使用 Eclipse 编译器,它可以使用 Java 5 JVM 编译 Java 6 源代码 - http://help.eclipse.org/indigo/topic/org.eclipse.jdt.doc.user/tasks/task-ant_javac_adapter.htm - 您还需要下载适当版本的 ecj.jar)

关于java - Zxing用J​​ava 1.5编译2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9697962/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com