Java packaging jar and war files (Eclipse)

Source: Internet
Author: User
Objective:

Why do you want to hit the jar bag?

1, for example, when writing a tool class library, there are more than 10 classes, each class corresponding to a class file, in order to facilitate the invocation of others, is not to be installed in a file, easy to pass and reference.

2, hit Jar package also has a benefit, that is, does not include the source file, for some confidential information of the library, jar package and code opacity is a preferred.

3, easy to deploy and reference.

There are two types of packaged jars, containing the main entry and not the main entry, which are usually tested with the main entrance. The Include main entry is also called an executable jar file.

The war is for Web projects, and the war package is also for ease of deployment.

When you package an executable jar file, there is usually a file manifest.mf that specifies the Main-class entry, which is typically placed in the root directory.

One, command line:

Second, GUI tools eclipse:

Three: Maven

This method is omitted and will be used to explain the build of Maven in the future.

Java packaging jar and war files (Eclipse)

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.