I am sorry if this has been asked, i have been looking all over for hours, but i cant find the exact way to deal with this. The problem is as follows, i made an app using a few libraries and i tried compiling the app which wouldnt run. After some searching around and reading i ve found out that you cant make a single "fat" jar with signed dependencies. Now i am wondering if there is a way to simply not build the jar with any dependencies and just have them with the app and use all of them that way. I ve been reading on manifest.me edit, but i cant find the exact procedure or a guide to make it work. I am using intelij and any help would be much appreciated.
To make it a bit less confusing, this is the error i get 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 java.base/sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:340) at java.base/sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:282) at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:327) at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239) at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:762) at java.base/java.util.jar.JarFile.ensureInitialization(JarFile.java:1033) at java.base/java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:72) at java.base/jdk.internal.loader.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:888) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:848) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:488) at java.base/java.lang.Class.forName(Class.java:467) at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:790) at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:685)
I found out that you cant create a single jar with those signed dependencies and that its causing the issue. What i cant find is how do i create the app leaving all dependencies in a folder which is somewhere relative to the jar and use them that way. I ve been reading on Classpath in manifest.mf, but i dont know where to edit it (project folder, inside IDE, etc) and how exactly to edit it, and i am not sure it would solve my problem at all.