Java Eclipse hits the jar package and executes the main function in the jar

Source: Internet
Author: User

Jar package using Eclipse packaging steps

Right-click on the item to be packaged-"SELECT Export"

There are two ways to pack up here.

1. If no other third-party package is used in the project, then the first one in the direct selection (JAR file)

2. If there are references to other third-party packages in the project, use the second (Runnable jar file) in the selection

This article describes the second type of

Launch configuration: Select the class of the main method to execute

Export Destination: Select Save Directory

Library handling: Select the third type, copy jar following; finish

Package completed, R1.jar in the same directory in the jar, r1_lib for the jar to be referenced. It is important to note that both must be placed in the same directory

Use:

If an environment variable is configured, it can be directly passed to the current report directory by using the JAVAC environment variable

If you do not configure environment variables, you need to go to the directory in the JDK's Bin directory where you use Javac-jar to navigate to R1.jar

Java Eclipse hits the jar package and executes the main function in the 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.