What is jar archives, JAVA Programming

Assignment Help:

What is JAR archives?

JAR archives are ZIP archives along with a different extension. They contain a hierarchy of files and directories. In spirit a JAR file can take the place of a directory containing its contents. This has several uses involving the distribution of associated classes as a single file.

The JDK involve a jar program modeled after the Unix tar program in which will bundle up files and directories into a JAR archive. For instance, suppose your homework directory contains the file Trivia.class.

Now suppose in which Trivia is in the package edu.poly.utopia.eharold.games. Also suppose that the directory /home/users/eharold/homework/ contains (in various sub-directories) all the files and directories essential to run the program edu.poly.utopia.eharold.games.Trivia. You can pack up everyhting in the edu package into a JAR archive like this:

$ cd /home/users/eharold/homework
$ jar cvf eharold.jar edu
The edu directory and all its contents are recursively stored in the archive named eharold.jar. The name of the archive is not important, only its contents.

This archive might now be added to the class path like this, or in whatever fashion you normally add directories to the class path on your platform of choice:

$ setenv CLASSPATH $CLASSPATH:eharold.jar

The major thing to note here is in which the JAR file is now taking the place of an whole directory hierarchy.
In Java 1.2 you can also place it within the ext directory of your jre/lib directory.

Either way, all the classes in the archive will be added to the class path and will be easy to get to to your programs.


Related Discussions:- What is jar archives

Write a program on filling rectangles, Write a program on Filling Rectangle...

Write a program on Filling Rectangles ? The drawRect() method draws an open rectangle, a box if you prefer. If you need to draw a filled rectangle, use the fillRect() method. O

Unix-like CLI in Java (simple), The assignment is implementing a CLI in Jav...

The assignment is implementing a CLI in Java with several usable commands, using Threads.

Want an expert with knowledge of uml diagrams, Want an expert with knowledg...

Want an expert with knowledge of UML diagrams and writing experience for pages writing including diagrams. This project needs 3-4 pages of technical writing about tickets reserv

What is an abstract class, What is an abstract class? Abstract class mu...

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

Use of unicastremoteobject in rmi, What is the use of UnicastRemoteObject i...

What is the use of UnicastRemoteObject in RMI? Ans) The UnicastRemoteObject class gives support for point-to-point active object references using TCP streams. Objects that need

Create an executable application in java, This assignment requires you to d...

This assignment requires you to design, implement and test a program using Java features from the first half of the subject content. You are required to implement in Java all the c

What are the services in rmi, An RMI "service" could well be any Java metho...

An RMI "service" could well be any Java method that can be invoked remotely. The other service is the JRMP RMI naming service which is a lookup service.

Explain the methods of java.lang.object, Explain The Methods of java.lang.O...

Explain The Methods of java.lang.Object? java.lang.Object gives a number of methods that are general to all objects. toString() is the most general such method. Because the def

Develop contact list application, Develop Contact list application Proje...

Develop Contact list application Project Description: Prepare a computer application to help employees manage their contact list. Users must be able to store two kinds of con

Write a program to perform multiplication and division, Write a program to ...

Write a program to perform multiplication and division in java? Of course Java could also do multiplication and division. Because most keyboards don't have the times and divisi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd