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