Project will build in IntelliJ but jar file will not run
I basically have the exact same problem described here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360002817359-I-m-selecting-the-correct-class-with-Main-but-Jar-will-not-execute
I am building the jar file in Intellij, and I can run my application there, but then when I build the jar file, it does not work. If I try to execute the jar file, I get this error.
Error: Could not find or load main class main.java.MainWindows.JBioFrameworkMain
Caused by: java.lang.ClassNotFoundException: main.java.MainWindows.JBioFrameworkMain
Even though I know I am choosing the correct main class. I have already gone through the four proposed solutions in the link I have posted above. I unzipped the jar file and looked at the manifest file and it looks ok. I have also searched my project for other signed jar files.
Please sign in to leave a comment.
Please share a sample project to reproduce the issue: https://uploads.services.jetbrains.com/.
Thank you for your help! I just uploaded the jar file. Upload ID: 2020_07_15_8mWgjonPe1iwcBye
The jar file is empty (has no .class files at all).
See https://stackoverflow.com/a/42200519/104891 for the sample project.
I just uploaded another new jar file. Based on the example above, I was trying to do option 1 and extract with all the dependencies into a single jar file.
Upload ID: 2020_07_15_QY2pB2c1nhQzb3Ak
It will not work at least because of the digital signatures inside, see https://stackoverflow.com/a/45169655/104891.
BCKEY.DSA
BCKEY.SF
Thank you!! Removing those files solved my problem.