Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building jar JNI error #1862

Open
IndianBartonka opened this issue Oct 4, 2024 · 2 comments
Open

Building jar JNI error #1862

IndianBartonka opened this issue Oct 4, 2024 · 2 comments
Labels
question Further information is requested

Comments

@IndianBartonka
Copy link

IndianBartonka commented Oct 4, 2024

How i can fix this error?
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 java.base/sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:339)
        at java.base/sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:281)
        at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:320)
        at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:232)
        at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:760)
        at java.base/java.util.jar.JarFile.ensureInitialization(JarFile.java:1070)
        at java.base/java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:42)
        at java.base/jdk.internal.loader.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:841)
        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:525)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:529)
        at java.base/java.lang.Class.forName(Class.java:508)
        at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:841)
        at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:736)

I using java 17 with :

<dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcpkix-jdk15on</artifactId>
                    <version>1.70</version>
                    <scope>compile</scope>
                </dependency>

My build:

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.6.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>pl.indianbartonka.sync.DesktopClient</mainClass>
                                </transformer>
                            </transformers>
                            <finalName>${project.name}${jar.suffix}-${project.version}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources/</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
@dghgit
Copy link
Contributor

dghgit commented Oct 13, 2024

Use the latest jdk18on release. 1.70 is way out of date.

@IndianBartonka
Copy link
Author

IndianBartonka commented Oct 14, 2024

Use the latest jdk18on release. 1.70 is way out of date.

Still the same when I use

   <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk18on</artifactId>
                    <version>1.78.1</version>
                    <scope>compile</scope>
                </dependency>

@winfriedgerlach winfriedgerlach added the question Further information is requested label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants