2016-04-28 23 views
3

IntelliJで実行するとうまく動作するコマンドラインで実行されるプロジェクトがあります。しかし、私は.jarファイルを構築し、私は次のエラーを取得するコマンドラインから実行する場合:私は、コマンドjava -jar JarName.jarIntelliJを使用して.jarをビルドするときのエラー?

乾杯を使用してjarファイルを実行しようとしている

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) 

+0

役立つかもしれない別のポストを見つけました。 JARファイルをビルドすると、署名された依存関係が抽出され、この問題が発生します。この回答を確認してください: http://stackoverflow.com/questions/41746177/how-do-i-create-a-runnable-jar-in-intellij-as-i-would-in-eclipse/43855741#43855741 –

答えて

2

実行コンフィギュレーションを編集して、VMオプション、プログラム引数、またはEnv変数があるかどうかを確認できますか?これらのパラメーターは、コマンド行を使用して実行する場合に渡す必要があります。

私は、これは署名の依存関係が原因である “Invalid signature file” when attempting to run a .jar

+0

返事をありがとう、私は見ていたし、それらのいずれかではないように思わない。あなたが投稿したリンクも見て、それが修正されているかどうか確認してください。 – Cypher236

+0

あなたがリンクしたスレッドの返信を読んで修正することができました!おかげで多くの仲間 – Cypher236

関連する問題