4

I have a project that runs in the command line which works fine when I run it within IntelliJ. However when I build the .jar and run it from the command line I get the following error:

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) 

I'm trying to run the jar using the command java -jar JarName.jar

Cheers.

1
  • This is due to the signed dependencies. When you build JAR file, the signed dependencies are extracted, which causes this issue. Please check this answer: stackoverflow.com/questions/41746177/… Commented May 16, 2017 at 9:52

1 Answer 1

3

Can you Run --> Edit Configuratios and check if there are any VM options, Program arguments or Env variables ? You might need to pass these parameters if you run it using the command line.

I found another post that might help “Invalid signature file” when attempting to run a .jar

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the reply, I had a look and nope there doesn't seem to be any of those. I'll have a look at the link you posted as well and see if that fixes it
I managed to fix it reading through the replies on the thread you linked! Thanks a lot mate

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.