从IntelliJ生成.JAR [英] Generate .JAR from IntelliJ

查看:107
本文介绍了从IntelliJ生成.JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用构建工件从IntelliJ创建JAR,但是当我这样做的时候

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?

推荐答案

很难告诉您所发布的内容. Intellij有时可能很挑剔,尤其是在使用Artifact jar构建界面的情况下. IntelliJ网站上有一个很好的教程,介绍如何设置工件.一个可能会带来困难的领域是指向主要阶层.

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.

在使用该工具构建jar时遇到的一个问题是选择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.

从intellij网站上: https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html

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

请注意下图.

其他潜在问题可能是依赖项已损坏,尽管值得怀疑.

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

也可能是清单文件正在引用导致该问题的文件.大多数清单文件应相当简单,并指向主类.最后但并非最不重要的电子邮件IntelliJ.他们善于回应,如果问题是intellij可以解决的问题,他们将为您提供帮助.不幸的是,他们只通过电子邮件回复,有时可能需要一天的时间.

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.

这篇关于从IntelliJ生成.JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆