I. Packaging a JAR file
1
If the class file
Jar CVF Myjar.jar Foo.class bar.class
If the package
Jar CVF Myjar.jar Pack
Pack under Eclipse
You need to package the program project name, click the appropriate menu command "File>>export" of the Eclipse programmer, then the Export box appears, select Java>>jar file, then choose the location of the JAR files (Browse), and then NEXT, finally choose an entry program with main function for the executable software!
Two. package as an executable file
1. Under cmd
For the sake of convenience, you follow my catalogue and step by step.
The following contents are the contents of the file (copying only 2 lines equal to the number)
Main-class:roundbutton
Copy your roundbutton.class to the D:\ABC directory.
And then
Start--"run--" tap cmd to open the command line,
Enter CD D:\ABC carriage return
Input d: Carriage return
Enter the jar CVFM Abc.jar MANIFEST. MF * *
Enter
Then you can see the ABC directory has a file called Abc.jar, double-click can run, jar package name to change, do not affect
(Note: It is recommended to only hit the SRC directory under the class file, the Lib directory below the jar file do not enter).
2. Under Eclipse
Similar to the above export, the jar file is changed to runnable jar file
Java hit jar Package