jar using ant tool Vs  jar using jar utility avail with  jdk

Posted on 2007-10-09
Last Modified: 2008-09-05
Are there any difference between the jar file created using ant tool and creating manually with the help of jar utility, available with jdk.  Because there is a size difference when I modify a jar file its size gets reduced by half.

Jar file has 600 kb.  I extract it and replace it with the modified file (though I can use mf option).  When I do jarring again that jar only shows 312 kb.  I could not find out what exactly went wrong.
    LVL 86

    Accepted Solution

    They're not necessarily the same. Did you specify compression?
    LVL 92

    Assisted Solution

    there just using different compression (which you can specify via command line/ant aparameters)
    LVL 92

    Expert Comment

    LVL 86

    Expert Comment

    The first one may have been using no compression at all

    Author Comment

    by:Ravi Kiran Reddy Katkuri
    can you please answer below questions related to comparision:
    1. What comparition is done in the jar files.
    2. What kind of comparision is included in the jar while creating
    3. What is the sintax to include the comparision in the jar files, while creating the Jar in, command line/ant parameters
    LVL 86

    Expert Comment

    1. Zip compression is done unless specified none ( -0 )
    2. Don't understand - only entries are compressed (see 1)
    3. jar has only the option not to compress (see 1) Ant uses level="0" to level="9"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One Java Help from Top Experts

    Solve your toughest problems, fast.
    Java experts are online now and ready to help you.

    Suggested Solutions

    Title # Comments Views Activity
    seriesUp challenge 7 80
    hasOne  challenge 59 63
    bigHeights  challenge 13 43
    Basics of Drool Rule Engine with few samples 2 31
    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now