Java invalid or corrupt jarfile

Suppose you have an error:

invalid or corrupt jarfile

Or related one:

Error: Could not find or load main class com.test.package.Main

The first thing you need to do is to check your main class defined in manifest.

If you’re 100% sure that everything is all right, then check any running JVM processes, associated with that file and kill them.

The thing is that you probably ran the old version of the jar, and forgot to stop it. Even if you’ll replace the file itself with the new version, it won’t work, as long as you have your old version running in JVM.

That’s all.

Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at promark33@gmail.com.

If I saved your day, you can support me 🤝

Leave a Reply

Your email address will not be published. Required fields are marked *