Create a jar package for a java Project

Source: Internet
Author: User

1. the java project has not imported a third-party jar package

Packaging is simple at this time:

1. Open the project in Eclipse, right-click the project, and select "Export ";
2. Select Java/JAR file and Next;
3. In Select the resources to export, you can Select the project folder you want to include. Some unnecessary folders do not need to be put in, so as not to increase the space;
There are several options:
* Export generated class files and resources indicates that only generated. class files and other resource files are exported.
* Export all output folders for checked projects: Export all folders of the selected project
* Export java source file and resouces indicates that the exported jar package will contain your source code *. java. If you do not want to disclose the source code, do not select this option.
* Export refactorings for checked projects include some reconstructed information files.
In Select the export destination, Select the path of the exported jar, Next
4. On the next page, you can choose whether to export the *. class files containing warning warnings or error errors. Ignore him, Next
5. Configure the project on the next page. If a third-party jar package is not introduced to the project, we will use the default system option. The Main class must be set as the Main method entry class of your project)
* Generate the manifest file is used by the system to automatically Generate the MANIFEST. MF file. If your project does not reference other class-path files, you can select this item.
* Use existing mainfest from workspace. This is a custom. MF file. The format is as shown above.
* Seal content. Packet
* Main class. Here you can select your program portal. The jar package in the future will be the execution result of your portal class.
Finish. ......


This article is from the "My JAVA World" blog, please be sure to keep this source http://hanchaohan.blog.51cto.com/2996417/1295223

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.