Creating Jar with Intellij 2016 - No main manifest attribute

后端 未结 10 1714
清歌不尽
清歌不尽 2021-01-30 16:03

I am getting no main manifest attribute while running the jar create by Intellij. I extracted the jar and observed that there was another manifest

10条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 16:36

    I found a different solution to the ones posted. In the IntelliJ Project Structure Dialog used to build the contents of the .jar file, I had to manually add the META-INF folder containing the Manifest file. Here is how it looks at the end in the project structure dialog box. If you don't see the folder in the list of jar contents, then the manifest file is not part of the jar file.

    The way I include the folder manually is to click the plus sign, select the Directory Content option and then navigate to the META-INF folder.

提交回复
热议问题