How to create jar file using eclipse

I have a folder name called configurator that has many subfolders and class files. I need to create the configurator.jar file of this folder using eclipse. I followed the steps to create a jar file.

  • create java project
  • right-click on the project name, go to properties, go to the java build path, click on the source β†’ the source of the links, browse and select the configurator folder, add the necessary external libraries β†’ click ok.
  • Now I can see the folder structure in the navigator. Right click on the configurator folder and select export
  • select the jar file and save the jar file in the specified folder.

But after saving the jar file, I cannot see the class files inside the jar.

My question is : Why are class files not exported to the jar? How to do this using eclipse?

+8
source share
3 answers

Creating a JAR file using the Eclipse IDE:

Right-click on your project that you want to create a JAR file. Select Export from the context menu.

Select the JAR file from the Java folder and click Next.

In eclipse, the latest version of the Downloadable JAR file has been added.

Specify the destination path and click Finish to create the JAR.

+31
source

Select a specific project, on the right click-> Export

Under Java, select the JAR file, click Next

(Do not change any properties) select the location of the Jar file in which you want to save, and click "Next"

It will show the parameters of the JAR package. Do not make any changes, click Next.

Finally, select the location of the main class. Choose your specific class and then finish

Now your bank will be created in this place

0
source

JAR files can be created using the following method, which I said

Example:

step1: Create one project and name it as Project1

step2: Create another project and name it as Project2

step3: Creating packages for two projects

step4: Creating classes for projects

step5: Right-click on Project1, go to the export, in which select Java, to go to the jar files select Project1, then click ok and ok.

step6: Right-click Project2, create one folder in which you copy the jar file that we created for project1.

step7: Right-click on project2, go to properties, select buildpath, then click on libraries, then click ok, then ok.

step 8: then enter the import package in Project2

Your jar file is ready.

-4
source

Source: https://habr.com/ru/post/1494592/


All Articles