what are .jar files?

can anyone tell me what are .jar files and how can we create it?
I know these files play an important role in setting up a environment for a software..so that it can be installed..?
Please tell me the whole procedure for this??

Replies

  • Mahesh Dahale
    Mahesh Dahale
    JAR (Java Achieve Files) are compressed files that are used to bundle multiple
    files into a achieve file so the distribution can be managed easily.

    JDK includes a JAR tool that is used for creating JAR files.

    also use JCreator

    Creating an Executable jar File

    #-Link-Snipped-#
  • Manish Goyal
    Manish Goyal
    Thanks for these links...i will try it...if there will be further queries ..will post it here
    Thanks again
  • Manish Goyal
    Manish Goyal
    Guys it is going to be very tough for me to understand..how to create a executable jar files?
    can anyone please take some time and explain how to create executable jar file?Pleaseeeee
  • Morningdot Hablu
    Morningdot Hablu
    goyal420
    Guys it is going to be very tough for me to understand..how to create a executable jar files?
    can anyone please take some time and explain how to create executable jar file?Pleaseeeee
    hai goyal it,s simple right click on the file of which exe file you want to creat and then add to archive and give the archive name anything.exe......
    .
    finaly you got the exe file of thet file..../
  • shruti palod
    shruti palod
    Hi Goyal
    Java Archive (JAR) files are compressed files into which you can store many files. If you place the many classes that your application, or applet need in a JAR file, you reduce the size of your distributabels.

    here is how you can create executable jar files:

    First, make sure you have installed Java 1.2 or above. This facility is not available in previous versions of Java.
    Next, create your working java system. In general, you will want to put it into a package. For this example, I created a trivial HelloWorld application that prints out "Hello World" plus the first command line argument, and placed it into the package "psae". Therefore, the HelloWorld files (HelloWorld.class, HelloWorld.java) were located in the directory psae. I tested the system to make sure it worked before going on to the next step.
    In the directory in which the psae is located, created a file called "mainClass". This file contains a single line specifying where the main Class is to be found in the jar file. Note that I use the package specification. Here is the single line:
    Main-Class: psae.HelloWorld
    Note: make sure you type a carriage return after this line; some windows systems need it and will report a "Failed to load Main-Class manifest attribute" error.
    Next, I create a jar file called psae.jar using the "jar" command in Java2. I use the "m" command line argument to specify the manifest file mainClass, which adds information to the jar file on where the main class will be found. Here is the jar command:
    bertha:~ > jar cmf mainClass psae.jar psae
    Just for fun, and to check what's happened, I print the table of contents for the jar file I just created. Here's the command and its result:
    bertha:~ > jar tf psae.jar
    META-INF/
    META-INF/MANIFEST.MF
    psae/
    psae/HelloWorld.java
    psae/HelloWorld.class
    Having successfully created the jar file, I can now invoke java2 on it with the command line argument:
    bertha:~ > java -jar psae.jar Philip
    Hello World Phili
  • Manish Goyal
    Manish Goyal
    Thanks shruti

You are reading an archived discussion.

Related Posts

Hello CEans this is right that you can now meet and interact with him .. .😕 Any Guesses?😕 The answer is on twitter What is great is that he is...
hi...can anyone help me on my project "bluemesh : multihop scatternet formation"... BlueMesh forms scatternets without requiring the Bluetooth devices to be all in each other transmission range. The problem...
😀 :-( Hello Guys ..the above smily that you can see..have you ever thought how these smilies are formed? Today the thought arises in my mind...so just search on it..and...
hi, i`m ravi teja(can call me teja) i have 2 things to ask.. 1. i`m really interested in web development, no technology(asp.net or php...) preference in particular, but...not able to...
hey, i`m teja and now i`m in my final year 2nd semster of Btech and i gotta do a project work within a period of 3months from now. frankly speaking...