The jar command successfully completed the Java-jar command but prompted "No master manifest attribute"!

Source: Internet
Author: User

The jar command successfully completed the Java-jar command but prompted "No master manifest attribute"! Http://www.bieryun.com/1181.html

The jar command successfully completed the Java-jar command but prompted "No master manifest attribute"! I do not understand, I do not know how long before I used the jar and run successfully, but now do not, get a big half a day, I want to die. It is becoming increasingly felt that Java development is inconvenient and inconvenient to use. It's a double-loser!
JAR-CVF Allchar.jar Allchar.class (only one class file)

Java-jar Allchar.jar
Tip "No Master manifest attribute"

Javaw-jar Allchar.jar had no clue.

Make sure I've used the jar to pack and succeed before.
Method One,
?
After you have made the jar package, you need to change the manifest file. Open the generated jar with a MANIFEST.MF file and open it. Then there is a line main-class: This is empty. Add your class file to the back. For example, your file is Exec.java compiled is exec.class. So here's the exec. then enter, Be sure to have a carriage return after the name to get the cursor to the next line. This will allow you to generate a jar package to find your main class to run. It is not inconvenient to use Java development, it is just that you are not fine.
?
Method Two, when you export the jar package in eclipse, the following actions can also be
First, under the Jar File Specification dialog box in the Export Jar Exporting Wizard, select Export all output folders for check projects. Such as:

Second, in the wizard, next to the Jar Manifest Specification dialog box, in your main class input box, select your entry class. Such as

?

Then, finish, the resulting jar file can be executed in the Java Virtual machine via the Java-jar ***.jar command.

The jar command successfully completed the Java-jar command but prompted "No master manifest attribute"!

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.