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
Question 1 Describe any five buzz words in Java Question 2 Describe exception classes and also explain common exceptions in java Question 3  Describe primitive and

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n).   program in java // aakash , suraj , prem sasi kumar kamaraj college

? • ?read from a file a series of an infix algebraic expressions comprised of constant and variable operands (integers), operands (%, *, /, +, -) and parenthesis. Two slashes (//)

What is the basic difference among Publish Subscribe model and P2P model? Ans) Publish Subscribe model is typically used in one-to-many situation. It is unreliable but very quic

Printing Calculator Canvas Printing Calculator In this assignment we will continue to work on our canvas printing web service. Specifically we will make use of Javascrip

What is the purpose of garbage collection in Java, and when is it used? The purpose of garbage collection is to identify and discard objects that are no longer required by a pr

Create objects of student class by calling default Create objects of student class by calling default, parameterize and copy constructor Call student class different methods on

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 an abstract class? Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie. you may not

Objectives 1. To help you become comfortable with using inheritance and interfaces to construct type hierarchies. 2. To familiarize you with programming from specifications. A