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: 开发者_StackOverflow社区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
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
cvs admin -kb <jar>
cvs update -A <jar>
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.
精彩评论