Results 1 to 7 of 7

Thread: what is a JAR file?

  1. #1

    Thread Starter
    Hyperactive Member CaptainPinko's Avatar
    Join Date
    Jan 2001
    Location
    London, Ontario, Canada
    Posts
    332

    Question what is a JAR file?

    what is a JAR file? I know it stands for Java ARchive <i think> but does [B]THAT[\B] mean and what is its purpose
    "There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein

    If you are programming in Java use www.NetBeans.org

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Im not too sure so don't quote me on this. A JAR file is basically used to group your classes togther for furture deployment. I don't think that there is any automatic installation involved like there is using Visual Basics Package and Deployment wizard. Most people zip up(compress) their JAR files for subsequent extraction. I haven't really coded anything yet that i would want to deploy. Most of my projects are unfinished.

  3. #3

    Thread Starter
    Hyperactive Member CaptainPinko's Avatar
    Join Date
    Jan 2001
    Location
    London, Ontario, Canada
    Posts
    332
    Originally posted by Dilenger4
    Most of my projects are unfinished. [/B]
    Ain't that the truth eh!
    Is there anyway to unJAR a JAR?
    "There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein

    If you are programming in Java use www.NetBeans.org

  4. #4

  5. #5
    Lively Member tcullen's Avatar
    Join Date
    Nov 2001
    Location
    Kent, England
    Posts
    66

    Can you unJAR a JAR

    JAR = Java Archive File where all files are compressed ready for deployment.

    I think you can work on them if you have something like JBuilder Enterprise or Pro

    Amazing my first reply on a subject i thought i knew nothing about

  6. #6

  7. #7
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    jar files are neat. They save space and make your finished project easy to deploy. Ideally, when you distribute your product it will consist entirely of jar files. All of the files that you yourself created will generally reside in one jar file, while all of the other packages written by others will reside in their respective jar files.

    Jar files are easy to manipulate. The syntax is very similar to unix tar (tape archive).

    On the command line to create a jar file, you'd say:
    jar -cvf myjar.jar *.class
    c, v and f are independent options.
    c means create the archive
    v means verify (show me) each argument that is going into it
    f means the archive filename will appear next.

    There is also a manifest file option. I'm not sure what it is exactly, but we don't use it. I think it's a file that tells about all the classes in the archive, but I'm not exactly sure why.

    jar files are compatible with the zip format so you can unzip a jar. I wouldn't suggest making a jar with zip just to be on the safe side.

    Another thing--if you want to see all the classes that are in your jar or somebody else's jar try:
    jar -tf other.jar

    You can even extract all the classes by typing
    jar -xvf other.jar

    Because java classes are wonderfully small to begin with, we don't bother with compressing our jars. From our perspective, a compressed jar is less desirable because of the decreased speed of decompressing it.

    Marlin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width