Use eclipse to generate jar files

Source: Internet
Author: User

Many people do not know how to generate jar files in eclipse, or they will always receive

Exception in thread "Main" Java. Lang. noclassdeffounderror :******

This error message.

In fact, generating jar files in eclipse is very simple:

1. Right-click the project to generate the jar and select export from the menu)

2. Select JAR file for the export type.

3. Select or enter the generated path

4. The manifest file is generated by default. You can also save the generated file to the specified path.

ProgramClick "Browse". eclipse will automatically detect the classes that can be cut in. Just select the class you want to use as the starting point.

(The following is an example of my own program. The manifest file is automatically generated and saved to the triangle folder of the workspace. The file name is manifest and the entry point is clstriangle)

(Generated JAR file)

5. Run the JAR file and enter:

Java-jar E:/mytriangle. Jar

Run successfully,

Many of my friends generate the JAR file and execute it with simple input.

Java jar_file_path

In this case, the JAR file cannot be executed. You only need to add the parameter-jar.

Related Article

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.