Java hit jar Package

Source: Internet
Author: User

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

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.