Can't execute jar- file: “no main manifest attribute”

后端 未结 30 1911
不知归路
不知归路 2020-11-21 22:30

I have installed an application, when I try to run it (it\'s an executable jar) nothing happens. When I run it from the commandline with:

java -jar \

30条回答
  •  醉话见心
    2020-11-21 23:00

    I had this issue when creating a jar using IntelliJ IDEA. See this discussion.

    What solved it for me was to re-create the jar artifact, choosing JAR > From modules with dependencies, but not accepting the default Directory for META-INF/MANIFEST.MF. Change it from -/src/main/java to -/src/main/resources.

    Otherwise it was including a manifest file in the jar, but not the one in -/src/main/java that it should have.

提交回复
热议问题