views:

77

answers:

4

Cany one please give me what are the different ways of creating the jar files.

Through programmatically we can create using java.util.jar Other than these method, please share your knowledge

A: 

Trivial: Use your IDE's export-function.

Ham
A: 

If you are using Netbeans IDE, it is very simple. Just the follows,

  1. Set as your project as "Main Project".
  2. Go to "Run" menu, and in that select "Clean and Build" item.
  3. Then automatically the jar file will be created in the specified folder.
  4. You can view the jar in the "dist" folder of your project.
Venkats
+1  A: 

It depends on your use-case. Normally you'd use a build tool for this. Check out:

  • Maven
  • Gradle
  • Ant (just google them) They all can build jar files for you.
Albert
+2  A: 

The most Frequently used approaches are :

1.jar command

2.OS specific zip

3.Utility and then rename it to Jar

4.IDE export Utility

5.Build tools Like ANT,Gradle,etc