Invalid signature file digest

Full error text:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

This error can be encountered if there are signed libraries among the dependencies of your project. To solve the problem, you need to exclude files with the extensions .SF, .DSA, .RSA from the build.

Of course, we will assume that you are building uber jar (fat jar).

For Maven:


For Gradle:

exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")

Complete code of the build task:

tasks.register<Jar>("uberJar") {
        configurations.runtimeClasspath.get().filter {"jar") }.map { zipTree(it) }
    exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")

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

If I saved your day, you can support me 🤝