[英]No Main Manifest Attribute, IntelliJ
I Have been having this issue for a while and today finally solved it. 我已经有一段时间了,今天终于解决了。
When creating a Jar artifact in IntelliJ and trying to run it, I always got the error 在IntelliJ中创建Jar工件并尝试运行它时,总是出现错误
no main manifest attribute, in xxxx.jar xxxx.jar中没有主清单属性
The problem ONLY occured when I added library files to the artifact, and without external libraries the jar executed fine. 仅当我将库文件添加到工件时才发生此问题,并且在没有外部库的情况下,jar可以很好地执行。
The process I followed to create the artifact was as follows : File -> Project Structure -> Artifacts -> add Jar -> from modules with dependencies... -> After The Next Windows the following was shown 我遵循的创建工件的过程如下:文件->项目结构->工件->添加Jar->来自具有依赖项的模块...->在下一个Windows之后,显示以下内容
And my problem was fixed when I removed all the items that had 'Extracted" prefixes. I also added The Library File to look like this -> Which made my jar with library dependencies work again 而且,当我删除所有带有“ Extracted”前缀的项目时,我的问题已得到解决。我还添加了“库文件”,使其看起来像这样->这使具有库依赖项的jar再次工作 ] 2 ] 2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.