Generate .JAR from IntelliJ

守給你的承諾、 提交于 2021-01-29 04:31:35

问题


I am attempting to create a JAR from IntelliJ using the build artifacts but when I do it is saying

Error: Invalid or corrupt jarfile 

Im not sure what im doing wrong though?


回答1:


Hard to tell from what you have posted. Intellij can be finicky at times especially with the Artifact jar build interface. There is a good tutorial on IntelliJ's website on how to set up the artifact. One area that may provide difficulty is pointing to the Main Class.

An issue I had in building a jar using the tool was selecting the Main Class. Ultimately I typed it in and it worked. Not sure if this is the advice that will solve your problem.

From the intellij website at: https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html

Note the image below.

Other potential issues could be that a dependency was corrupted, although doubtful.

Could also be the Manifest file is referencing a file that is causing the issue. Most Manifest files should be fairly simple and point to the main class. Last but not least email IntelliJ. They are good at responding and if the problem is one that intellij can solve, they will help. Unfortunately they only respond by email and sometimes can take up to a day.



来源:https://stackoverflow.com/questions/58036941/generate-jar-from-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!