JAR file runtime: failed to load main-class manifest attribute from ......

Source: Internet
Author: User

When you double-click the packaged JAR file to run it, the following error occurs: failed to load main-class manifest attribute from..., which is caused by the portal program that has not been set to run.

Right-click your jar file, select Open Method -- WinRAR -- open the META-INF folder, double-click the manifest. after opening the MF file, you will find that there is only manifest-version: 1.0, and there is no main-class: XXX configuration.

Solution ------------------

Re-open your eclipse, select the project that requires export, right-click Export, and select JAVA -- JAR File

After selecting the project to be exported, click Next --- next to go to the following page:

Note the main class here: (you certainly do not have any text information), Click Browse, select your main function, and then finish.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.