There was a problem when working with Intellijidea 16 to package a Java program into an executable jar package.
Error:invalid or corrupt jarfile project.jar problem, unable to run JAR package
Workaround:
My final requirement is to make the program and external dependencies into a runnable jar package instead of separating the program and dependencies, so select artifacts in file---Project Structure, click +, select Jar, select from modules with Dependencies.
Come out like:
In main class, select the class that contains the main method that is ultimately running in the program. Since I want to make external dependencies and programs into a jar package, select the first one in the jar files from libraries and choose the second if you want to separate the program and dependencies from the jar package.
In directory for meta-inf/manifest. MF needs to add resources at the end, the default is no, and the resources file will cause the final jar package to not run (for specific reasons not yet found ...). )
Click OK, then go all the way by default. Finally, build on the external select build, build artifacts, and then run under the generated Jar package directory: Java-jar project.jar command.
Intellijidea hit executable jar package