Site icon TestingDocs.com

Export a Jar file in Eclipse

Overview

In this tutorial, we will learn the steps to create and export a jar file in eclipse IDE. Jar files allow you to package the code and distribute them so that other projects can reuse the code.

Steps to create a jar file:

Launch Eclipse.

Open the project that you want to export.

Right-click on the project in the Project Explorer and Choose Export…

Select Java >> JAR file

 

Click on the Next > button.

Give a name to the jar file and choose the resources that you want in the jar file.

Click on the Next > button.

 

 

In the next screen, you can specify the jar packaging options. Click on the Next > button.

Jar File Manifest

In the next screen you can generate the manifest file and seal the contents of the jar file.

 

 

The manifest file is a file named  MANIFEST.MF. This contains the version and other details.

For a runnable jar, this file contains the class name which has the entry point i.e the main method.

Click on the Finish button to create the jar file.

See the below link to know how to use this created jar file in another project.

How to use the jar file created in another project.

 

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Exit mobile version