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

后端 未结 30 1974
不知归路
不知归路 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 22:52

    If you are using the command line to assemble .jar it is possible to point to the main without adding Manifest file. Example:

    jar cfve app.jar TheNameOfClassWithMainMethod *.class
    

    (param "e" does that: TheNameOfClassWithMainMethod is a name of the class with the method main() and app.jar - name of executable .jar and *.class - just all classes files to assemble)

提交回复
热议问题