How to Fix ZipException: Invalid LOC Header
ZipException means Java couldn't read a jar or zip file because it is damaged, empty or cut off. How to find the broken file and replace it.
Quick Fix
Find the jar named near the exception, delete it and download it again from its official page.
Error Message
java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)How to Fix
Look at the lines around the exception for a file path, which tells you which jar was being read.
Delete that jar and download it again from Modrinth, CurseForge or the mod's own site.
If no file is named, move half of the mods out of the folder, start the game, and keep halving until the error disappears.
For a damaged server or launcher jar, delete it and let the launcher or your host download it again.
Run a disk check if downloaded files keep breaking, since the problem is then the drive and not the download.
Common Causes
- A jar is damaged inside. Java reads a file entry whose header doesn't start with the expected signature and throws ZipFile invalid LOC header (bad signature).
- The download stopped early. A zip file keeps its directory at the very end, so a cut-off jar gives zip END header not found.
- The file is empty or isn't a zip at all, such as a 0 byte file or a web page saved under a .jar name. Java then reports zip file is empty or zip END header not found.
- Disk errors changed the file after it was downloaded.
Diagnostic Steps
- Find the jar named near the ZipException.
- Delete it.
- Download it again from its official page.
- Start the game and check the log.
FAQ
How do I know which jar is corrupted?
Look for a file path next to the exception in the log. If there isn't one, remove mods in halves until the game starts, then add them back to find the broken file.
What does zip END header not found mean?
Java couldn't find the directory that every zip and jar file keeps at its end. The file was cut off, or it isn't a zip file at all.
Can I repair a corrupted jar?
Downloading a fresh copy from the official page is the reliable fix. A damaged jar is missing data that a repair tool can't bring back.