Java – on IntelliJ 13, the created executable jar is invalid or corrupt

I try to create an executable jar from a project on IntelliJ 13 (win8). According to these answers, how to build jars from IntelliJ properly? And execute the created jar, and then I get "error: invaid or corrupt jar file", and then the path of the jar

My project is simple, but it has multiple java files and a UI form

After building, I called Build Build Build Artifacts Jar. after creating jar artifacts on Project Structure Artifacts.

I created the project using maven scafold, but did not rely on POM xml.

I'm using java 7 What is missing?

Solution

This is a no POM Fast solution of XML

I solved this problem by creating a "meta inf" subfolder and copying the manifest file in it, using IntelliJ's artifact settings

I don't know why I even need it, but it seems that IntelliJ idea does not contain the meta inf folder by default

Point to file:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>