How do I generate a jar file with eclipse? Introduction to eclipse Export jar

Source: Internet
Author: User

1, we need to increase the configuration file jar needs, select the project's src directory, right mouse button, select [New]-select [Folder].

2. Enter Meta-inf as the directory name and click [Finish].

3, select the directory you just created, right mouse button, select [New], select [File].

4, input MANIFEST. MF, select [Finish].

5, edit the file, modify the following content:

manifest-version:1.0

Main-class:lession1. HelloWorld

Class-path:spring.jar Spring-mock.jar Spring-aspects.jar

The picture is:

6, modify our HelloWorld, add a line, for easy to see the effect of operation.

The picture is:

7. Start exporting the jar. SELECT [File] from the menu to select [Export].

8. Select the jar file type below Java and click [Next].

9. Click [Browse ...] to select the target location we exported.

10, please choose according to their own situation, the file name is Myproject.jar, click [Save].

11, this page has some parameters, the third is to overwrite the previous jar, we select, the second is to add the directory, I chose.

12. Select [Next].

13, the default is to generate a configuration file, we select the files we have built in the previous.

14. Click [Browse ...] to select the file.

15. Select the file we created and click [OK].

16. Click [Finish].

17, find our generated jar file, double-click Run, get our expected results.

18. At this point, the jar file is created.

Joptionpane.showmessagedialog (NULL, "Our output jar is ready to run", "Test jar header",

Joptionpane.ok_option);

How do I generate a jar file with eclipse? Introduction to eclipse Export jar

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.