Skip to main content

Jar utility can compress files?

Java archive creator is the Jar tool. Is it just a packaging tool or does it compress and package (like zip utilities)? It can compress and package, also by default compression is on. So all the jar files that others have created so far may be compressed (since they did not turn off that).

You can turn off the compression feature by using the 0 (zero) option of the jar command. The command would look like follows.

jar cvf0 TicTacToe.jar *.class

So what's the big deal? It's always better to compress it!!! Many may think so?

No, that's not the truth. There are reasons why you should turn off the compression. For a situation where a jar file is loaded to a browser, uncompressed jar will be suitable over a compressed jar. Uncompressed JAR files can generally be loaded more faster than compressed files because the need to decompression overhead is eliminated. However there's a trade-off, for an uncompressed jar download time over a network may be longer. So decision must be taken by considering both aspects.


  1. Hi Kamal!
    Wow, most of this stuff is soooo over my head :)) I mean, I thought I was a techno-neophyte but when I visit a site like this, I KNOW it!

    I have been looking into adsense for my site, but I have heard some not so good things about it, what has been your experience overall?

  2. Welcome Rachelle. Up to now, no issues. You can email me separately to talk more on this topic.

  3. Hi Kamal

    I agree with rachelle. This stuff is way,way over my head.
    I enjoyed the story about the American GI whose wife gave birth 2 years after his death, using his sperm.

    I am still struggling with my site. I would like to make it look nice but I still am short of the tehcnicalknow how.


  4. Hi Kamal, just a little message to say a big thanks for your kind comments. Your encouragement is greatly appreciated. Similar to Rachelle's comments - your blog data is a bit over my head but nonetheless, looks extremely impressive and professional. Kind reagrds, Arty Dave

  5. Welcome Englishsinseh and Dave, all your comments are appreciated and keep in touch as I'm not posting only tech stuff.

  6. Hi all non-tech readers, you can find non-tech posts here, Interesting posts


Post a Comment

We appreciate your opinions, suggestions and criticism.

Popular posts from this blog

Web Services with Apache Axis 1.4 Tutorial: server and client sides

Java Sorting: Comparator vs Comparable Tutorial

Creative Commons License Digizol by Kamal Mettananda is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License .
URL of this page must be supplied in attribution
© 2004-2017