How to generate a. jar file for a Java project instead of a bunch of jar files (eclipse generates jar files)

Source: Internet
Author: User

I am writing a Java project, which is an API provided to the customer to call, but my API requires about 10. Jar files,

In the past, I used the export JAR file function of eclipse to export jar files. Such jar files can be used, but the package customers who depend on my APIs still need to import them, in this way, we need to import a total of 11 packages, which is too troublesome. Now we want to include the API and the dependent jar into a jar, which is much more convenient,

 

Now, the jar exported using the Export runnable JAR file function of eclipse3.4 contains the dependent jar. You can import this jar as follows,

1. First find the class that provides interfaces in your project (including the main method ),

2. Right-click the class and choose run

3. Select Run configurations

4. In the main window, select main class as the class.

5. Click Run.

6. Right-click your project and choose Export

7. In the pop-up window, select runnable JAR File

8. Select the class you Just configured in the first launch configuration in the pop-up runnable JAR File Export window,

In the second window, select the path you want to export

9. Then select next.

 

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.