Naveen P.N

Just another Blog to play with programming

How To create A JAR File

leave a comment »

Hi friends follow the steps carefully to create the jar file.
Consider the following example
//Here the main class name is Sample
class Sample
{
public static void main(String ar[])
{
———–
————
}
}

Step 1 :  Create the text file that lists the main class name and save it as mainClass.txt
Main-Class:Sample

Note :After typing the above text press Enter so the file contains two lines one is text and the oteher is blank line.

Step 2 : Now go to command prompt and type
jar cmf  mainClass.txt  example.jar  *.class

Step 3 :Jar file will be created sucessfully

Written by Naveen P.N

November 4, 2008 at 12:46 pm

Leave a Reply