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






Your posts are moderated
Related Questions
Extraction of articles The software I'm looking to build: 1. Extraction of articles from various sites 2. Format the content to re-post 3. Automate the process Skill

Create problem that solves cryptoarithmatic problem that uses from user using java

I need Crime Management Project Description: It is a web based project build in Oracle(back end) and J2EE(front end)  for peoples so they will register complaints online.

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

1. Lifecycle Management : Individual enterprise beans do not accept to explicitly manage process allocation, object activation, thread management, or object destruction. The EJ


Explain Overriding Methods: The Solution The object oriented solution to this problem is to describe a new class, call it SlowCar, that inherits from Car and imposes the additi


How to Scaling Images in java applet? You can scale an image within a particular rectangle using this version of the drawImage() method: public boolean drawImage(Image img,

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