Windows ANT 构建上的 CVS 签出:无效的 CEN 标头(错误签名)
我在 CVS 中有代码,当我签出代码并在 Windows 机器上进行 ANT 构建时,我收到以下错误。
Buildfile: C:\Java\JDeveloper\library\build.xml
compile:
[javac] Compiling 181 source files to C:\Java\JDeveloper\library
[javac] error: error reading C:\Java\JDeveloper\library\lib\jdom.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\tidy.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\parser.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\syslog.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\regexp.jar; invalid CEN header (bad signature)
[javac] 5 errors
BUILD FAILED
我已经检查过很多次了。这段代码将在我的 Linux 机器上检查并构建良好。我尝试从命令行使用 CVS、JDeveloper 和 Eclipse 进行检查,在 Windows XP 机器上都得到相同的结果。我在网上看到帖子说 JAR 已损坏,但这似乎很奇怪,因为相同的 JAR 在 Linux 机器上可以正常编译。我尝试过删除并使用新的 JAR。我在命令行中使用 CVSNT 得到了相同的结果。 谢谢, 汤姆
I have code in CVS and when I checkout the code and do an ANT build on my Windows box I receive the following errors.
Buildfile: C:\Java\JDeveloper\library\build.xml
compile:
[javac] Compiling 181 source files to C:\Java\JDeveloper\library
[javac] error: error reading C:\Java\JDeveloper\library\lib\jdom.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\tidy.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\parser.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\syslog.jar; invalid CEN header (bad signature)
[javac] error: error reading C:\Java\JDeveloper\library\lib\regexp.jar; invalid CEN header (bad signature)
[javac] 5 errors
BUILD FAILED
I have checked it out numerous times. This code will checkout and build fine on my linux box. I have tried checking it out with CVS from command line, using JDeveloper and Eclipse all with the same result on the Windows XP box. I have seen posts on the web that the JARs are corrupt but that seems odd since the same JARs will compile fine on the linux box. And I have tried deleting and using new JARs. From the command line I was using CVSNT with the same result.
Thanks,
Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
值得检查的一件事是 jar 是否已无意中作为非二进制文件添加到 CVS。
您可以使用在 Windows 系统上将它们标记为二进制文件,
检出非二进制文件可能会导致单字符的转换
行尾变成两个字符 - 这会破坏真正的二进制文件,就像罐子一样。
在 unix/linux 系统上查看同一个文件时,您可能不会注意到这一点
在那里签出时,没有对“文本”文件进行特殊处理。
此外,如果从 Windows 系统作为文本文件签入,则由于行结束转换和关键字替换,二进制文件可能会损坏。
One thing worth checking is whether the jars have inadvertantly been added to CVS as non-binary files.
You can mark them as binary using
On Windows systems check-out of a non-binary file can lead to conversion of one-character
line-endings to two-character - which corrupts a true binary like a jar.
You might well not notice this when checking out the same file on a unix/linux system as
there is no special treatment for "text" files when checking out there.
Also, the binaries can get corrupted if checked in from a windows system as text files, due to line ending conversion, and to keyword substitution.