Java Project Export runnable jar file

Source: Internet
Author: User

"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "

Scenario One: Java projects are not dependent on third-party jar packages


        1. First open the project in MyEclipse, right click on the project, select "Export",
        2. Select Java/jar File,next;
        3. Select the resources to Export you can choose the project folder you want to include, some unnecessary folders do not need to put in, so as not to increase the space;
There are several options:
    * Export Generated class files and resources means that only the generated. class file and other resource files are exported,
    * Export all output folders for Checke D projects to export all folders of the selected item,
    * Export Java source file and Resouces indicates that the exported jar package will contain your source code *.java if you do not want to leak Source code, then do not choose this,
    * Export refactorings for checked projects Some of the reconstructed information files are included.

Select the path to the exported jar in the Select the export destination, Next.
4. On the next page, you can choose whether to export *.class files that contain warning warning or error errors. Generally, don't worry about him, Next.
5. The next page can be configured for the project. (If the project does not introduce a third-party jar package, this is the system default option for Ok,main class to be set to be the Main method entry class for your project).
* Generate The manifest file is the system to help us automatically generate MANIFEST.MF files, if your project does not reference other Class-path, then you can choose this.
* Use existing mainfest from workspace. This is optional and we can customize it. MF file, formatted as above.
* Seal content. To encapsulate the entire jar or the specified package packet
* Main class. Here you can choose your program portal, the future packaging of the jar is your entry class execution results.
Final finish, done.

Scenario Two: Java projects have dependencies on third-party jar packages


1. Right click on the project, click Export= java= to select the third, Runnable jar file (executable jar), Next,
2. Choose

Launch configuration (Program entry config),

Exportdestination (export target),
Library handing:

Selecting the first referenced jar package will be integrated into the project.
Selecting the second referenced jar package is placed separately under the project root directory (recommended).
Select the third referenced jar package will be placed in a separate folder, this folder and exported jar in the same directory, finish.

Problems:

Question:
Why export-->runnable Jar file's launch configuration has nothing to choose from?
Answer:
MyEclipse export-->runnable jar file--> of the launch configuration there is no choice, in fact, you want to package into a jar file of the project's main method to run once, For example, the main method in Class A, run a once. So easy!!

"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "

Java Project Export runnable jar file

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.