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

后端 未结 30 1967
不知归路
不知归路 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:45

    Any executable jar file Should run either by clicking or running using command prompt like java -jar app.jar (use "if path of jar contains space" - i.e. java -jar "C:\folder name\app.jar"). If your executable jar is not running, which means it is not created properly.

    For better understanding, extract the jar file (or view using any tool, for windows 7-Zip is nice one) and check the file under /META-INF/MANIFEST.MF. If you find any entry like

    Main-Class: your.package.name.ClaaswithMain - then it's fine, otherwise you have to provide it.

    Be aware of appending Main-Class entry on MANIFEST.MF file, check where you are saving it!

提交回复
热议问题