MyEclipse Use summary-use MyEclipse to package the jar with source code

Source: Internet
Author: User

In peacetime development, we like to pack some classes into a jar package, and then continue to use in other projects, but because there is no way to see the source of the class inside the jar package, so it can not debug, to debug, then only through the form of related source code, so more or less inconvenient, Today teaches you a way to pack the jar package, so that the jar package has both compiled class, and the source code corresponding to the class, so that in other projects using packaged jar package, you can directly see the source code of the class, you can also direct source debugging, No additional correlation source code is required, as follows:

If there is an item as shown

  

Now we need to package the Java class in the SRC directory into a jar package, so we can do this by checking the src directory → right → "Export" as shown in:

  

  

  

By clicking the Fish button, you can package all the classes in the SRC directory into a single Simplemvcframework.jar, as shown in:

  

We can use the compression tool to open this jar package and see the contained files in it, as shown in:

  

Usually this is how we pack some of the developed class into a jar package, open the jar package can be seen, this packaging method is not the Java source code corresponding to the class, then you want to generate the jar package contains class corresponding Java source code, then how to do it, It is also very simple, the key steps are as follows:

  

Click Finish to generate Simplemvcframework-0.1-bin-with-src.jar, use the compression tool to open the Simplemvcframework-0.1-bin-with-src.jar, you can see that there are both class and class corresponding Java source code, as shown in:

  

When we introduce this jar package in another project, when we open the class in the jar package, we automatically associate the source code as shown in:

  

This is a kind of packaging skills, for some of our own developed classes, packaged into a source-code jar package, easy to use and debugging in other projects.

MyEclipse Use summary-use MyEclipse to package the jar with source code

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.