Explain jar archives, JAVA Programming

Explain JAR Archives ?

HTTP 1.0 uses a separate connection for every request. When you're downloading several small files, the time required to set up and tear down the connections can be a significant fraction of the total amount of time needed to load a page. It would be better if you could load all the HTML documents, images, applets, and sounds a page required in one connection.

One way to do this without changing the HTTP protocol is to pack all those various files into a single archive file, perhaps a zip archive, and just download that.

We aren't quite there yet. Browsers do not yet understand archive files, other than applets do. You can pack all the images, sounds, and .class files an applet needs into one JAR archive and load which instead of the individual files. Applet classes do not have to be loaded directly. They can also be stored in JAR archives. To do this you use the ARCHIVES attribute of the APPLET tag
< applet code="HelloWorldApplet"
width="200" height="100"
archives="HelloWorld.jar">
< hr>
Hello World!
< hr>
< /applet>

In this example, the applet class is still HelloWorldApplet. Therefore, there is no HelloWorldApplet.class file to be downloaded. Instead the class is stored inside the archive file HelloWorld.jar.
Sun provides a tool for creating JAR archives with its JDK. For example,
$ jar cf HelloWorld.jar *.class

This puts all the .class files in the current directory in the file named "HelloWorld.jar". The syntax of the jar command is deliberately same to the Unix tar command.

Posted Date: 5/16/2013 6:05:00 AM | Location : United States







Related Discussions:- Explain jar archives, Assignment Help, Ask Question on Explain jar archives, Get Answer, Expert's Help, Explain jar archives Discussions

Write discussion on Explain jar archives
Your posts are moderated
Related Questions
Explain the user defined Exceptions. User Defined Exceptions are the exceptions which are defined by user for specific purposed. This enables custom exceptions to be generated

What are Access Specifiers available in Java? Java has four access specifiers, which are enlisted below: Public: public methods, classes and fields can be accessed by ever

What is Constraints explain with example? One of the purposes to use constructors and setter techniques rather than directly accessing fields is to enforce constraints. For exa

When should I use abstract classes and when should I use interfaces?  Use Interface, when: Design changing often or when various implementations only share method sign

The break statement is utilized for terminating the current While or For loop and after that transferring program control towards statement just after the terminated loop. The foll


Write the hashCode() method of java.lang.Object Anytime you override equals() you should also override hashCode(). The hashCode() method should ideally return the similar int f

The Struts tag libraries are: ? HTML Tags ? Logic Tags ? Template Tags ? Bean Tags ? Tiles Tags ? Nested Tags

what is arrays and how do they operate

Why You don't need to import java.lang.* There is one exception to the import rule. All classes in the java.lang package are imported by default. Therefore you do not required