Wednesday, July 30, 2014

Creating User Defined Jar File In Java

In java jar file  contains collection of classes and interfaces.If you want to create our user defined jar file use the following steps.

step1:

Develop user defined  classes and interfaces under any user defined package

step2:

Compile the above created classes and interfaces any location in your hard disk drive:

C:>javac -d . filename.java

step3:

Go to command prompt type the following command,

C:>jar cf satya.jar myPack1\*.class

Here cf--------create file,      satya.jar-------jar file name,        myPack1------content of the jar file

step4: If you want to know the content of your jar file use the following command

          C:>jar ft satya.jar





No comments:

Post a Comment