Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create jar file using eclipse

Tags:

java

eclipse

jar

I have a folder name called configurator which has many sub folders and class files. I need to create a configurator.jar file of this folder using eclipse. I followed below steps to create jar file.

  1. create a java project
  2. right click on project name, go to properties, go to java build path, click on source --> link source, browse and select configurator folder, add required external libraries --> click ok.
  3. Now, I am able to see the folder structure in navigator. Right click on configurator folder and select export
  4. select jar file and save the jar file in specified folder.

But, after saving the jar file, i am not able to see the class files inside the jar.

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

like image 373
user2635337 Avatar asked Jul 31 '13 22:07

user2635337


1 Answers

Creating a JAR file using Eclipse IDE:

Right click on your project, which you want to create a JAR file of. And select Export from the context menu.

Select JAR file from Java folder and click Next.

In eclipse Latest version Runnable JAR file is added.

Provide the Destination path and click on Finish to create the JAR.

like image 183
mehdi Avatar answered Oct 21 '22 23:10

mehdi