简体   繁体   中英

Copying a jar file from Windows 7 to Unix gives java.util.zip.ZipException

I am copying a jar file from Windows 7 to my application lib folder on Unix machine through WinScp. On starting my application, i am getting the below error. Is the jar file corrupted while copying it. What is the correct way to copy the jar ?

java.util.zip.ZipException: invalid END header (bad central directory offset)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:127)
    at java.util.jar.JarFile.<init>(JarFile.java:135)
    at java.util.jar.JarFile.<init>(JarFile.java:72)

Are you using WinSCP in binary mode? It does have a text transfer mode which will cock up a jar file.

https://winscp.net/eng/docs/transfer_settings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM