If you run a Minecraft server, you might have come across cryptic errors such as “zip file closed” from various plugins, mods, or even the server itself. The error will often show up as java.lang.IllegalStateException: zip file closed. These errors can be caused by many different problems, most of which can easily be resolved. It’s also important to note that if a specific plugin or mod is mentioned in the error, it does not mean that plugin or mod is the problem.

Possible Causes and How to Fix it

Replacing JAR files while the server is running

The most common cause of errors like this is replacing jar files while the server is running. These can be jar files of plugins, mods, or even the server itself, all can cause this error. If this is what has caused the error, the fix is simple. Just restart your server, and in the future only replace jar files while the server has shut down. Given the way Java works, it can sometimes need to load code from jar files while the server is running. If a jar file is swapped out, suddenly the code that it is loading might not match up what it has loaded before, causing unexpected behaviour and errors.

Another way this can happen is if the jar file has actually been removed. Either by the file changing name, being deleted, getting moved, or the physical device being unplugged.

Background software modifying files

This can also happen while running a server within a cloud-synced folder, such as OneDrive or Dropbox, as they often change files as they’re used. Other software that can impact files in this way are Antivirus programs, backup software, or anything that performs occasional system scans. These can all cause the file to be marked as modified, and Java to get confused and consider the file closed.

Plugins failing to load

In some cases, a plugin failing to load can cause this error to happen for other plugins that access the failing plugin. To fix this, check your logs to see if any plugins are not loading, and ask the developers of those plugins for help. Generally, this will be most noticeable due to other errors occurring in your logs other than the “zip file closed” ones. In these cases, it’s a good idea to get all of the others fixed to see if it resolves the issue.

Reloading the server

Bukkit-based servers such as Paper include a /reload command, which is known to cause issues. While there are many more devastating issues that command can cause, one possible issue is the “zip file closed” error. To resolve this, restart your server and don’t use /reload, or plugins such as PlugMan to reload plugins.

Running broken forks of Paper

Many servers are now running modified forks of the popular server software Paper, however some of these can contain large numbers of bugs and other issues. Some of these forks make buggy changes in a component known as a classloader, which is what Bukkit-based servers use to load plugins. A straightforward way to tell if this is your issue is to switch to Paper and see if that resolves the issue. If it does, issue solved.

JVM Bug

Worst case, it’s also possible you’ve either hit a Java bug, or a bug in the distribution of Java that you have downloaded. Many different companies package their own releases of Java, some of which can have modifications that will affect running a Minecraft server. A known working distribution of Java is AdoptOpenJDK. Other gotchas to look out for with Java distributions is making sure that they aren’t headless, and that you’re running the latest version compatible with your release of Minecraft.

Low quality Minecraft server host

If you’re using a Minecraft server host, it’s possible poor configuration of the underlying systems that power your Minecraft server are causing this issue. It can be hard to identify a good Minecraft server host, but determining if they’re causing this issue can be even harder. Usually if your host is causing this issue, it’ll be due to either software they’re running in the background that’s modifying files like mentioned above, or due to a broken version of Java being installed on the machine. If you’ve tried everything else and found that nothing is working, it might be worth contacting your host’s support about the issue.

Malware

It's also possible that this error is caused by the presence of malware. If this is the case, you should follow the steps outlined in this article to remove the malware from your system.

If it’s still an issue

If it’s still an issue, it’s time to start narrowing down any plugins or mods you have until the issue is resolved. There are many ways to do this, some are outlined in this post. From here, your best bet is to ask for support from the developers of the server software you’re using. Be it Paper, Forge, Fabric, or something else. It’s possible they’ve got a bug, or something else less common is going on.

Conclusion

The zip file closed error can be hard to pin down, as it nearly never tells you what’s causing it. Luckily in most cases the fix is simple. Be it no longer doing harmful things, or switching server software, almost all cases can easily be solved.

This article is part of a series on how to run a Minecraft server. Click here to find out more

About the Author

Maddy Miller

Hi, I'm Maddy Miller, a Senior Software Engineer at Clipchamp at Microsoft. In my spare time I love writing articles, and I also develop the Minecraft mods WorldEdit, WorldGuard, and CraftBook. My opinions are my own and do not represent those of my employer in any capacity. Find out more.