I created a JAR artifact in IntelliJ with option to extract JAR files to the target JAR. Look like this:
I filled the manifest information properly:
I checked the content of the JAR file with ZIP and it contains the jar files, the properly filled MANIFEST.MF and the .class files for my project.
But if I try to run it, it drops an error:
d:\Own_Tools\REF_Standalone\build>java -jar REF_Standalone.jar
Error: Could not find or load main class com.continental.ref.REFController
I am pretty sure it contains com\continental\ref\REFController.class.
Do you have any idea what went wrong with it?
Thanks: Levente
apache-commons.jar
is digitally signed (you can tell it by the FILETEST.DSA
and FILETEST.SF
in the META-INF
directory).
When the artifact jar is packaged, these files are copied into the new jar, but they do not contain the signatures for other classes in your new jar.
This breaks the jar signature and JVM doesn't allow the execution of the jar for the security reasons.
See my another answer for the workaround (just delete *.SF
and *.DSA
files from apache-commons.jar
and rebuild the artifact).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With