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

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

    I found a new solution to bad manifest generation !

    1. Open the jar file with a zip editor like WinRAR
    2. Click on for META-INF

    3. Add or edit

      • Add:

        • Create a text file called MANIFEST.MF in a folder called META-INF and add the following line:

          • Manifest-Version: 1.0
          • Main-Class: package.ex.com.views.mainClassName
        • Save the file and add it to the zip

      • Edit:

        • Drag the file out modify the MANIFEST.MF to add the previous line
    4. Open cmd and type: java -jar c:/path/JarName.jar

    It should work fine now !

提交回复
热议问题