Java encapsulates its own APIs

Source: Internet
Author: User

As we learn more, we all want to encapsulate our own APIs, but it is not easy for new users!

What I want to achieve: encapsulate some methods, export the jar package, add it to other projects, and there will be comments!

1. encapsulate your own Api. This step is very simple. Just write it yourself!

2. export javadoc. This step is also very simple: export, java, javadoc. In the javadoc command, select C: \ Program Files \ Java \ jdk1.7.0 _ 45 \ bin \ javadoc.exe, the specific path depends on your own!

After export, there will be an additional doc directory in the project, which is the help document!

3. Export the jar package, similar to 2, but select javadoc instead of jar file! Export!

Usage:

1. Copy It To The libs directory of the corresponding project, add it to the Java Build Path, and then expand it, as shown in:

Here, my jar package is: MyApi. jar expand, select Javadoc location, and click Edit on the right. The pop-up window is as follows:

Select Javadoc in archive, select Workspace file, and select jar package in Archive path! Path within archive refers to the Path of the doc directory in the jar package! Select it!


OK, just enjoy it!

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.