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"
< 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
Relate Java with C/C++ Very similar C/C++ syntax, operators, etc. Core language is simpler than C++ -- no pointers, no operator overloading, and no multiple inheritance.

I need to know waht exactly is happining in the following code class Worker implements Runnable { DatagramSocket socket = null; DatagramPacket packet = null; public W

Liferay Especialist and Java Programmer Project Description: We require to make a full functional Portal with online tools. JSF, Java, Portlets, Skills required: CSS

Super() Constructer: It is used to call constructor of parent class. Should be the first statement in the body of constructor. Using this we can access private variables

Describe the relational operators in java? Java has six relational operators which compare two numbers and return a boolean value. The relational operators are , > , , >=

In this lab, you will practice using ArrayLists in two ways.  The first is in the problem domain class Question.java (see the UML diagram shown below) which contains data for trivi

15. Energy Drink Consumption A soft drink company recently surveyed 12,467 of its customers and found that approximately 14 percent of those surveyed purchase one or more energy dr

What is constructor chaining and how is it achieved in Java? A child object constructor always first requires to construct its parent (which in turn calls its parent constructo

Employee application Project Description: Subsequent Technology should be used 1) UI (jsp, jstl ,html, etc) 2) Framework (Spring MVC and hibernate) 3) Database (MYSQ