1

I am using the IntelliJ IDEA to create a jar artifact from a LeanFT project.

The jar artifact was generated, but with the following error message:

JNI error has occurred, please check your installation and try again

when trying to execute the jar file directly.

It is working when I use the IDE for execution. No arguments or parameter values are required. I am getting the same error when I generate a jar file from a simple "Hello World".

Stack trace:

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
        at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
        at sun.security.util.SignatureFileVerifier.process(Unknown Source)
        at java.util.jar.JarVerifier.processEntry(Unknown Source)
        at java.util.jar.JarVerifier.update(Unknown Source)
        at java.util.jar.JarFile.initializeVerifier(Unknown Source)
        at java.util.jar.JarFile.getInputStream(Unknown Source)
        at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
        at sun.misc.Resource.cachedInputStream(Unknown Source)
        at sun.misc.Resource.getByteBuffer(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Ivar
  • 6,138
  • 12
  • 49
  • 61
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
  • A lot of information is needed in order to help you out buddy.Are you using Maven in order to create your Jar artifact and if so, how exactly did you configure your pom.xml regarding this packaging/insytallation? Also, are you actually using JNI in your project? – Rann Lifshitz May 10 '18 at 14:49
  • I built it from modules with dependencies, don't use Maven. No, I don't use JNI. – plaidshirt May 11 '18 at 08:00

2 Answers2

1

It's likely something to do with the version of java installed on your PC. check that it is the same as the java version being used to compile your code.

HamishD
  • 349
  • 2
  • 15
1

I looked into the exception you got : Invalid signature file digest for Manifest main attributes.

Are you using signed jar files as dependencies of your project? If so, when you generate a jar containing the dependencies, then try to execute it - the JVM detects your generated jar as a manipulation of the signed jars you are using.

Here is a list of questions where this exception was encountered:

Follow the links above and find the exact solution which will help you. The solution depends on what exactly you are doing, deployment-wise (specifics of how you are creating your jar artifact).

Rann Lifshitz
  • 4,040
  • 4
  • 22
  • 42